#include<bits/stdc++.h>
using namespace std;
const long long p=1000000007;
int n,m;
long long ans=0;

long long power(int x)
{
  long long re=1;
  for (int i=1;i<=x;i++)
    {
    re*=2;
    re%=p;
    }
  return re;
}

int main()
{
  freopen("barrack.in","r",stdin);
  freopen("barrack.out","w",stdout);
  
  scanf("%d%d",&n,&m);
  for (int i=1;i<=n;i++)
    {
    ans+=(n-i+1)*power(i-2)*power(n-i);
    ans%=p;
	}
  printf("%lld",ans);
  
  return 0;
}