#include<bits/stdc++.h>
#define int long long
using namespace std;
int mod=1e9+7;
int n,m,cnt,tot,res,F[500010],Siz[500010],siz[500010],col[500010],t[500010],dfn[500010],low[500010],f[500010][2],s[500010],num[500010];
bool cut[1000010],used[500010];
queue<int>Q;
vector<pair<int,int> >e[500010];
vector<int>G[500010],V;
inline int qpow(int a,int b){
	int res=1;
	while(b){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}
inline void Tarjan(int u,int from){
	dfn[u]=low[u]=++tot;
	for(auto i:e[u]){
		int v=i.first,w=i.second;
		if(v==from)continue;
		if(!dfn[v]){
			Tarjan(v,u),low[u]=min(low[u],low[v]);
			if(low[v]>dfn[u])cut[w]=1;
		}
		else low[u]=min(low[u],dfn[v]);
	}
}
inline void bfs(int s){
	col[s]=++cnt,siz[cnt]=1,Q.push(s);
	while(!Q.empty()){
		int u=Q.front();Q.pop();
		for(auto i:e[u]){
			int v=i.first,w=i.second;
			if(col[v])continue;
			if(cut[w])continue;
			col[v]=cnt,siz[cnt]++,Q.push(v);
		}
	}
}
inline void DFS(int u,int from){
	if(used[u])F[u]=0;
	for(int v:G[u]){
		if(v==from)continue;
		DFS(v,u);
		if(F[v]!=-1)F[u]+=F[v]+1;
	}
}
inline int calc(){
	int l=m;
	for(int i=1;i<=cnt;i++)
	if(used[i]){DFS(i,0);l-=F[i];break;}
	int res=1;
	for(int i=1;i<=cnt;i++)
	if(used[i])res=res*t[i]%mod,l-=num[i];
	return res*qpow(2,l)%mod;
}
inline void dfs(int x,int s){
	if(x>cnt){
		if(s==0)return;
		for(int i:V)used[i]=1;
		for(int i=1;i<=cnt;i++)F[i]=-1;
		res=(res+calc())%mod;
		for(int i:V)used[i]=0;
		return;
	}
	dfs(x+1,s);
	V.push_back(x);
	dfs(x+1,s+1);
	V.pop_back();
}
inline void Dfs(int u,int from){
	if(from==0)f[u][1]=t[u],f[u][0]=qpow(2,num[u]);
	for(int v:G[u]){
		if(v==from)continue;
		f[v][1]=(f[u][1]+f[u][1]*(qpow(2,num[v])+t[v])%mod+f[u][0]*t[v]%mod*2%mod)%mod;
		f[v][0]=f[u][0]*qpow(2,num[v])%mod*2%mod;
		Dfs(v,u);
	}
	if(G[u].size()==1){
		cout<<f[u][1];exit(0);
	}
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	std::ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>n>>m;
	for(int i=1,x,y;i<=m;i++){
		cin>>x>>y;
		e[x].push_back({y,i});
		e[y].push_back({x,i});
	}
	Tarjan(1,0);
	for(int i=1;i<=n;i++)if(!col[i])bfs(i);
	for(int u=1;u<=n;u++)
	for(auto i:e[u]){
		int v=i.first,w=i.second;
		if(col[u]!=col[v]&&cut[w])G[col[u]].push_back(col[v]);
		if(col[u]==col[v])num[col[u]]++;
	}
	for(int i=1;i<=cnt;i++)num[i]>>=1;
	for(int i=1;i<=cnt;i++)t[i]=qpow(2,num[i])*((qpow(2,siz[i])-1+mod)%mod)%mod;
	if(cnt<=16){
		dfs(1,0);
		cout<<res;
		return 0;
	}
	Dfs(1,0);
	f[1][0]=qpow(2,num[1]);f[1][1]=t[1];
	for(int i=2;i<=cnt;i++){
		f[i][1]=(f[i-1][1]+f[i-1][1]*(qpow(2,num[i])+t[i])%mod+f[i-1][0]*t[i]%mod*2%mod)%mod;
		f[i][0]=f[i-1][0]*qpow(2,num[i])%mod*2%mod;
	}
	cout<<f[cnt][1];
	return 0;
}