#include<bits/stdc++.h>
#define For(i,l,r) for(int i=(l);i<=(r);++i)
const int mod=1e9+7;
typedef long long ll;
using namespace std;
int n,m;
ll ans;
ll qpow(ll x,int y)
{
	ll res=1;
	while(y)
	{
		if(y&1)
			(res*=x)%=mod;
		(x*=x)%=mod;
		y>>=1;
	}
	return res;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
	For(i,1,m)
	{
		int u,v;
		scanf("%d%d",&u,&v);
	}
	(ans+=(1ll*n*qpow(1ll*2,n-1)))%=mod;
	For(len,2,n)
		(ans+=(1ll*(n-len+1)*qpow(1ll*2,n-2)))%=mod;
	printf("%lld",ans);
	return 0;
}