#include<iostream>
#include<cstdio>
#define maxn 500005
#define maxm 1000005
#define mod 1000000007
#define ll long long
using namespace std;
int n,m,u,v; struct node{int to,nex;}a[maxm*2]; int head[maxn],cnt=0; ll ans=0LL;
void add(int from,int to){a[++cnt].to=to; a[cnt].nex=head[from]; head[from]=cnt;}
ll qp(ll di,ll mi){ll res=1; while(mi){if(mi&1) res=res*di%mod; di=di*di%mod; mi>>=1;}return res;}
int main(){
	freopen("barrack.in","r",stdin); freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m); for(int i=1;i<=m;i++){scanf("%d%d",&u,&v); add(u,v); add(v,u);}
	if(n==1){printf("1"); return 0;}
	ans=((1LL*(1LL*n*(n-1)/2)%mod*qp(2LL,1LL*n-2LL)%mod)+(1LL*n*qp(2LL,1LL*n-1LL)%mod))%mod;
	printf("%lld",ans); return 0;
	return 0;
}
/*
By qzhwlzy
T3 barrack
------code------
point 10~11 -> 10pts
starts at  10:42 
ends   at  11:19
----------------
*/

