#include <bits/stdc++.h>
#define int long long
using namespace std;
const int Maxn=5e5+10;
const int Mann=1e6+10;
const int mod=1e9+7;
struct node{
	int x,y;
}zry[Mann];
int n,m,i,ans,p;
int jy[Maxn],gs[Maxn];
bool jl[Maxn];
int read()
{
	int s=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		s=(s<<3)+(s<<1)+c-'0';
		c=getchar();
	}
	return s*f;
}
int ksm(int x)
{
	if(jy[x]) return jy[x];
	int p=1,q=2,r=x;
	while(x)
	{
		if(x&1) p=(p*q)%mod;
		x=x>>1,q=(q*q)%mod;
	}
	return jy[r]=p;
}
void js(int x,int y,int z)
{
	if(x>m) return;
	for(int i=x;i<=m;i++)
	{
		if(!jl[zry[i].x]&&!jl[zry[i].y]) continue;
		if(jl[zry[i].x])
		{
			if(jl[zry[i].y]) ans=(ans+ksm(z)-1)%mod,js(i+1,y+1,z);
			else jl[zry[i].y]=true,ans=(ans+ksm(z+1)-1)%mod,js(i+1,y+1,z+1),jl[zry[i].y]=false;
		}
		else jl[zry[i].x]=true,ans=(ans+ksm(z+1)-1)%mod,js(i+1,y+1,z+1),jl[zry[i].x]=false;
	}
	return;
}
signed main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	for(i=1;i<=m;i++)
	{
		zry[i].x=read(),zry[i].y=read();
	}
	if(m==n-1)
	{
		ans=((ksm(m)*n)%mod+(ksm(m-1)*((n*(n-1)/2)%mod)))%mod;
		printf("%lld",ans);
	}
	else
	{
		memset(jl,false,sizeof(jl));
		for(i=1;i<=m;i++)
		{
			gs[zry[i].x]+=1,gs[zry[i].y]+=1;
		}
		for(i=1;i<=n;i++)
		{
			ans=(ans+ksm(m-gs[i]))%mod;
		}
		for(i=1;i<=m;i++)
		{
			jl[zry[i].x]=jl[zry[i].y]=true,ans=(ans+3)%mod;
			js(i+1,2,2);
			jl[zry[i].x]=jl[zry[i].y]=false;
		}
		printf("%lld",ans);
	}
	return 0;
}