#include<bits/stdc++.h>
using namespace std;
const int N=500010;
const int M=1000010;
const long long mod=1e9+7;
int zhan[N],siz;
bool vis[N];
int dfn[N],low[N],num;
int c[N],cnt;
int head[M*2],ver[M*2],nxt[M*2],tot=1;
long long size[N*2],lines[N*2];
long long dp[N*2],dp1[N*2],dpl[N*2];
int dline[N*2];
bool used[N*2];
int n,m;
int xc[M],yc[M];
long long ans;
long long po[M*2];
int read(){
	int f=1,l=0;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		l=l*10+(c-'0');
		c=getchar();
	}
	return f*l;
}
void addline(int x,int y)
{
	ver[++tot]=y;
	nxt[tot]=head[x];
	head[x]=tot;
}
void tanj(int x,int last)
{
	dfn[x]=low[x]=++num;
	vis[x]=1;
	zhan[++siz]=x;
	for(int i=head[x];i;i=nxt[i])
	{
		int y=ver[i];
		if(!dfn[y])
		{
			tanj(y,x);
			low[x]=min(low[x],low[y]);
		}
		else
		{
			if(y!=last)
				low[x]=min(low[x],low[y]);
		}
	}
	if(dfn[x]==low[x])
	{
		int y;
		cnt++;
		do{
			y=zhan[siz--];
			c[y]=cnt;
		}while(y!=x);
		
	}
}
void dfs(int x)
{
	used[x]=1;
	dp[x]=1;
	long long l=1,sum=0;
	for(int i=head[x];i;i=nxt[i])
	{
		int y=ver[i];
		if(!used[y])
		{
			dfs(y);
			dline[x]+=dline[y]+1;
			l=l*(dp[y]+1)%mod;
			sum+=dp[y];
			sum%=mod;
			dp[x]*=dp[y]+dp1[y]+po[dline[y]];
			dp[x]%=mod;
		}
	}
	dpl[x]=l-1-sum+mod;
	dpl[x]%=mod;
	ans+=(l-1-sum+mod)*po[m-dline[x]]%mod;
	dp1[x]=dp[x];
	dp[x]*=po[size[x]]-1+mod;
	dp[x]%=mod;
	ans+=dp[x]*po[m-dline[x]]%mod;
	ans%=mod;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	for(int i=1;i<=m;i++){
		xc[i]=read(),yc[i]=read();
		addline(xc[i],yc[i]);
		addline(yc[i],xc[i]);
	}
	cnt=n;
	tanj(1,0);
	for(int i=1;i<=n;i++)
		size[c[i]]++;
	for(int i=1;i<=m;i++)
	{
		if(c[xc[i]]!=c[yc[i]])
		{
			addline(c[xc[i]],c[yc[i]]);
			addline(c[yc[i]],c[xc[i]]);
		}
			
		else
			lines[xc[i]]++;
	}
	po[0]=(long long)1;
	for(int i=1;i<=n+m;i++)
	{
		po[i]=po[i-1]<<1;
		po[i]%=mod;
	}
	dfs(cnt);
	cout<<ans<<endl;
}










