#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i,l,r) for(ll i=l,i##end=r;i<=i##end;++i)
#define Rep(i,l,r) for(ll i=l,i##end=r;i<i##end;++i)
#define FOR(i,l,r) for(ll i=l,i##end=r;i>=i##end;--i)
ll read(){
	ll v=0;bool f=1;char c=getchar();
	for(;'0'>c||c>'9';c=getchar())
	    if(c=='-') f = 0;
	for(;'0'<=c&&c<='9';c=getchar())
	    v = (v<<3)+(v<<1)+(c^48);
	return f?v:-v;
}
const ll N = 5e5+10;
const ll P = 1e9+7;
ll n,m;
vector<ll> ev[N],ed[N];
ll cnt=0,dfn[N],low[N];
ll mi[N],pnm[N],lom[N],enm[N];
void tarjan(ll p,ll fm){
	dfn[p] = low[p] = ++cnt;
	Rep(i,0,ev[p].size()){
		ll v = ev[p][i];
		if(v==fm) continue;
		if(dfn[v]) low[p] = min(low[p],dfn[v]);
		else tarjan(v,p),low[p] = min(low[p],low[v]);
	}
}
ll cnl=0;
namespace A{
ll dep[N],fa[N];
bool ok[N],rd[N];
void dfs(ll p){
	Rep(i,0,ed[p].size()){
		ll v = ed[p][i];
		if(v==fa[p]) continue;
		dep[v] = dep[p]+1;
		fa[v] = p;dfs(v);
	}
}
void work(){
	dep[low[1]] = 1;dfs(low[1]);
	ll res = 0;
	For(i,1,(1<<cnl)-1){
		For(j,1,cnl) ok[j] = ((i>>(j-1))&1),rd[j] = 0;
		ll sum = 1;
		For(j,1,cnl) 
		    if(ok[j]) sum = sum*(mi[pnm[lom[j]]]-1)%P;
		For(j,1,cnl) if(ok[j]) For(k,1,cnl) if(j!=k&&ok[k]){
			ll u = lom[i],v = lom[j];
		    while(dep[u]>dep[v]) u = fa[u],rd[u] = 1;
		    while(dep[u]<dep[v]) v = fa[v],rd[v] = 1;
		    while(u!=v) u = fa[u],rd[u] = 1,v = fa[v],rd[v] = 1;
		}
		ll num = -1;
		For(j,1,cnl) if(rd[j]==0) ++num;
		res = (res+mi[num]*sum%P)%P;
	}
	For(i,1,n) res = res*mi[enm[i]]%P;
	printf("%lld\n",res);
}
}
//namespace B{
//void dfs(ll p,ll fa){
//	f[p][0] = f[p][1] = 1; 
//	Rep(i,0,ed[p].size()){
//		ll v = ed[p][i];
//		if(v==fa) continue;
//		dfs(v,p);
//		f[1]
//	}
//}
//}

int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	
	n=read(),m=read();
	For(i,1,m){
		ll u=read(),v=read();
		ev[u].push_back(v);
		ev[v].push_back(u);
	}
	
	tarjan(1,0);
//	For(i,1,n) printf("%lld ",low[i]);
	
	For(p,1,n){
		if(!pnm[low[p]]) lom[++cnl] = low[p];
	    ++pnm[low[p]];
	}
	For(p,1,n) Rep(i,0,ev[p].size())
	    if(low[p]==low[ev[p][i]]) ++enm[low[p]];
		else ed[low[p]].push_back(low[ev[p][i]]);
	mi[0]=1;For(i,1,max(n,m)) mi[i]=mi[i-1]*2%P;
	For(p,1,n) enm[p] /= 2;
	
	A::work();
	
	fclose(stdin);fclose(stdout);
	return 0;
}
