#include<bits/stdc++.h>
using namespace std;
int Mod=1e9+7;
int Ans=1;
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		Ans=Ans*2%Mod;
	cout<<Ans+n;
	fclose(stdin); fclose(stdout);
	return 0;
}