#include<bits/stdc++.h>
#define Pc(x) putchar(x)
#define PB push_back
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
using namespace std;using ll=long long;using ull=unsigned ll;
const int N=5e5+5,M=1e6+5,eps=1e-5,INF=1e9+7,mod=1e9+7;
int Si[N],n,m,k,x,y,z,scc[N],W[N],Ct;ll dp[N][3],Ans,Po[N];vector<int> S[N],G[N];
namespace Tarjan{
	int dh,low[N],dfn[N],st[N],sh;void Tarjan(int x,int La){
		low[x]=dfn[x]=++dh;st[++sh]=x;for(int i:S[x])if(i^La){
			if(dfn[i]) low[x]=min(low[x],dfn[i]);else Tarjan(i,x),low[x]=min(low[x],low[i]);
		}if(low[x]>=dfn[x]){Ct++;while(st[sh+1]^x) scc[st[sh]]=Ct,sh--;}
	}
	void BD(){for(int i=1;i<=n;i++) Tarjan(i,0);}
}
void Make(int x,int La){
	dp[x][0]=1;dp[x][2]=Po[W[x]]-1;Si[x]=1;
	for(int i:S[x])if(i^La){
		Make(i,x);Si[x]+=Si[i];
		dp[x][2]=(dp[x][2]*(dp[i][0]*2+dp[i][1]+dp[i][2])+dp[x][1]*(dp[i][1]+dp[i][2]))%mod;
		dp[x][1]=(dp[x][1]*dp[i][0]*2+dp[x][0]*(dp[i][1]+dp[i][2]))%mod;
		dp[x][0]=dp[x][0]*dp[i][0]*2%mod;
	}Ans+=dp[x][2]*Po[Ct-Si[x]]%mod;
}
void read(int &x){char c=Gc();x=0;while(c<'0'||c>'9') c=Gc();while(c>='0'&&c<='9') x=x*10+c-48,c=Gc();}
int main(){
	freopen("barrack.in","r",stdin);freopen("barrack.out","w",stdout);
	int i,j;scanf("%d%d",&n,&m);for(i=1;i<=m;i++)read(x),read(y),S[x].PB(y),S[y].PB(x);
	Tarjan::BD();for(i=1;i<=n;i++) {
		for(int j:S[i]) if(scc[i]^scc[j]) G[scc[i]].PB(scc[j]);
	}for(i=1;i<=n;i++) swap(G[i],S[i]);for(i=1;i<=n;i++) W[scc[i]]++;
	for(Po[0]=i=1;i<=n;i++) Po[i]=Po[i-1]*2%mod;
	Make(1,0);Ans=(Ans%mod+mod)%mod;for(i=1;i<=m-(Ct-1);i++) Ans=Ans*2%mod;
	printf("%lld\n",(Ans%mod+mod)%mod);
}