#include<bits/stdc++.h>
using namespace std;
const int Max_N=5e5,Max_M=1e6;
const long long Mod=(1e9)+7;
bool Be;
int n,m,cnt,Num,num,sum[Max_N+5],c[Max_N+5],sz[Max_N+5],lin[Max_N+5],dfn[Max_N+5],low[Max_N+5];
long long f[Max_N+5][3],B[Max_M+5];
bool vis[Max_M+5];
struct EDGE{ int u,v; } E[Max_M+5];
struct Edge{ int Id,Next; } e[Max_M*2+5];
bool Ed;
int Read(){
	int num=0; char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar());
	for(;ch>='0'&&ch<='9';num=num*10+ch-'0',ch=getchar());
	return num;
}
void Insert(int x,int y){
	e[++Num].Next=lin[x]; lin[x]=Num; e[Num].Id=y;
}
void dfs(int x,int fr){
	dfn[x]=low[x]=++num;
	for(int i=lin[x];i;i=e[i].Next){
		if(e[i].Id==fr) continue;
		if(!dfn[e[i].Id]){
			dfs(e[i].Id,x),
			low[x]=min(low[x],low[e[i].Id]);
			if(dfn[x]<low[e[i].Id])
			 vis[(i+1)>>1]=true;
		} else low[x]=min(low[x],dfn[e[i].Id]);
	}
}
void Dfs(int x){
	c[x]=cnt; ++sz[cnt];
	for(int i=lin[x];i;i=e[i].Next){
		if(c[e[i].Id]||vis[(i+1)>>1]) continue;
		Dfs(e[i].Id);
	}
}
void Solv(int x,int fr){
	f[x][0]=1; sum[x]=1;
	for(int i=lin[x];i;i=e[i].Next){
		if(e[i].Id==fr) continue;
		Solv(e[i].Id,x);	
		sum[x]+=sum[e[i].Id];
		f[x][2]=(f[x][2]*f[e[i].Id][0]*2ll%Mod+f[x][2]*f[e[i].Id][1]%Mod+f[x][1]*f[e[i].Id][1])%Mod;
		f[x][1]=(f[x][1]*f[e[i].Id][0]*2ll%Mod+f[x][0]*f[e[i].Id][1])%Mod;
		f[x][0]=f[x][0]*f[e[i].Id][0]*2ll%Mod;
	}
	f[x][2]=(f[x][2]+(f[x][2]+f[x][1]+f[x][0])%Mod*(B[sz[x]]+Mod-1))%Mod;
	f[x][1]=(f[x][1]+(f[x][1]+f[x][0])%Mod*(B[sz[x]]+Mod-1))%Mod;
}
int main(){
//	printf("%.0lf\n",(&Ed-&Be)/1024.0/1024.0);
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=Read(),m=Read();
	for(int i=1;i<=m;i++){
		E[i].u=Read(),E[i].v=Read();
		Insert(E[i].u,E[i].v),
		Insert(E[i].v,E[i].u);
	}
	dfs(1,0);
	for(int i=1;i<=n;i++)
	 if(!c[i]) ++cnt,Dfs(i);
	Num=0; memset(lin,0,sizeof(lin));
	for(int i=1;i<=m;i++)
	 if(vis[i]){
	 	Insert(c[E[i].u],c[E[i].v]);
	 	Insert(c[E[i].v],c[E[i].u]);
	 }
	B[0]=1; for(int i=1;i<=max(n,m);i++) B[i]=(B[i-1]<<1)%Mod;
	Solv(1,0);
	long long ans=0;
	for(int i=1;i<=cnt;i++) ans=(ans+f[i][2]*B[cnt-sum[i]]%Mod)%Mod;
	printf("%lld\n",ans*B[m-cnt+1]%Mod);
	return 0;
}
