//C
#include<bits/stdc++.h>
using namespace std;
long long n,m,x,y,z,t,k,op;
long long ans=0;
long long mod=1e9+7;
int a[610];
long long pow(long long s,long long nn)
{
	if(s==0) return 0;
	if(nn==0) return 1;
	if(nn==1) return s;
	
	if(nn%2==0) return pow((s*s)%mod,nn/2)%mod;
	else return pow((s*s)%mod,nn/2)%mod*s%mod;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	ans=n*pow(2,m);
	int i,j;
	for(i=1;i<=n;i++)
	for(j=i+1;j<=n;j++)
	ans=(ans+pow(2,m-(j-i))*pow(2,j-i-1));
	
	ans%=mod;
	
	cout<<ans;
	return 0;
}