#include<bits/stdc++.h>
using namespace std;
long long n,m,a1,a2,a3,ans,mod=1e9+7;
long long C(long long a,long long b)
{
	long long temp=1;
	for(long long i=1;i<=a;i++)
	{
		temp=(temp*(b-i+1)%mod)/i%mod;
	}
	return temp;
}
long long go(long long up)
{
	long long temp=0;
	for(long long i=0;i<=up;i++)
	{  	
		temp=(temp+C(i,up))%mod;
	}
	return temp;
}
long long qsm(long long a,long long b)
{
	long long temp=1;
	while(b)
	{
		if(b%2)
		{
			temp=(temp*a)%mod;
		}
		b/=2;
		a=a*a%mod;
	}
	return temp;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for(long long i=1;i<=m;i++)
	{
		long long x,y;
		cin>>x>>y;
	}
	for(long long i=0;i<=m;i++)
	{
		a1=n-i;
		a2=qsm(2,m-i);
		a3=max((long long)1,go(i-1));
		ans+=(a1*a2)%mod*a3%mod;
	}
	cout<<ans<<endl;
	return 0;
}