#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int M=17,N=27,Mod=1e9+7;
ll n,m,fa[M],ans,cnt[M];
struct node{ll x,y;}bian[M];
ll find(ll x){
	if(fa[x]==x) return x;
	return fa[x]=find(fa[x]);
}
void merge(ll x,ll y){
	ll fx=find(x),fy=find(y);
	cnt[fx]+=cnt[fy],fa[fy]=fx;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%lld%lld",&n,&m);
	ans=1;
	for(int i=2;i<=n;i++){
		ans=(ans*4+(1ll<<(i-2)))%Mod;
	}
	printf("%lld",ans);
	return 0;
}