#include<bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)((x).size()))
template<typename _Tp>void read(_Tp &x){
	char ch(getchar());bool f=0;while(!isdigit(ch))f|=ch=='-',ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
const int N=500005,mod=1000000007;
template<typename _Tp1,typename _Tp2>inline void add(_Tp1 &a,_Tp2 b){a=a+b>=mod?a+b-mod:a+b;}
template<typename _Tp1,typename _Tp2>inline void sub(_Tp1 &a,_Tp2 b){a=a<b?a+mod-b:a-b;}
std::vector<int> e[N],G[N];
int dfn[N],low[N],id,st[N],top,bel[N],col,val[N];
void tarjan(int x,int fa){
	dfn[x]=low[x]=++id,st[++top]=x;
	for(auto v:e[x])if(v!=fa){
		if(!dfn[v])tarjan(v,x),low[x]=std::min(low[x],low[v]);
		else low[x]=std::min(low[x],dfn[v]);
	}
	if(dfn[x]==low[x]){
		bel[x]=++col;
		while(st[top]!=x)bel[st[top--]]=col;
		--top;
	}
}
int dp[N][3];
void dfs(int x,int fa){
	dp[x][0]=1,dp[x][1]=val[x],dp[x][2]=0;
	for(auto v:G[x])if(v!=fa){
		dfs(v,x);
		dp[x][2]=((2LL*dp[v][2]+dp[v][1])*dp[x][0]+2LL*dp[v][0]*dp[x][2])%mod;
		dp[x][1]=1LL*(dp[v][0]+dp[v][1])*dp[x][1]%mod;
		dp[x][0]=2LL*dp[v][0]*dp[x][0]%mod;
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int n,m;read(n),read(m);
	for(int i=1,x,y;i<=m;++i)read(x),read(y),e[x].pb(y),e[y].pb(x);
	tarjan(1,0);int E=0;
	for(int i=1;i<=col;++i)val[i]=1;
	for(int i=1;i<=n;++i)val[bel[i]]=2LL*val[bel[i]]%mod;
	for(int i=1;i<=n;++i)for(auto v:e[i])if(bel[i]!=bel[v])G[bel[i]].pb(bel[v]);else E+=i<v;
	dfs(1,0);int ans=dp[1][2];add(ans,dp[1][1]);
	for(int i=1;i<=col;++i)val[i]=1;
	dfs(1,0),sub(ans,dp[1][2]),sub(ans,dp[1][1]);
	for(int i=1;i<=E;++i)add(ans,ans);
	printf("%d\n",ans);
	return 0;
}
