#include<bits/stdc++.h>
using namespace std;
const int N=1e3+5,mod=1e9+7;
int n;
int b[N];
long long ksm(long long a,long long b){
if(!b) return 1ll;
long long c=ksm(a,b>>1);
c=c*c%mod;
if(b&1) c=c*a%mod;
return c;
}
int main(){
freopen("01.in","r",stdin);
freopen("01.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++){
cin>>b[i];
}
cout<<ksm(2,n*n)<<"\n";
return 0;
}