#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e6+6,mod=1e9+7;
int u[N],v[N];
ll ans;
int n,m;
ll qpow(ll x, ll ba) {
	ll res=1;
	while(ba) {
		if(ba&1) res=res*x%mod;
		x=(x*x)%mod;
		ba>>=1;
	}
	return (res+mod-1)%mod;
}
int main() {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for(int i=1; i<=m; i++) {
		cin>>u[i]>>v[i];
	}
	for(ll i=1; i<=n; i++) {
		ans=(ans+i*qpow(2,n-i+1))%mod;
	}
	cout<<ans%mod;
	return 0;
}
/*
5 4
1 2
2 3
3 4
4 5
*/
