#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int mod=1e9+7;
const int N=1e6+5;
map<pair<int,int>,bool> Map;
vector<int> E[N],G[N];
int vet[N<<1],nxt[N<<1],edgenum,head[N],id[N<<1],flag[N],cnt[N],gg[N],ID[N],n,m,U[N],V[N],node;
int edge[N],sz[N],f[N][3],Suf[N],Pre[N],sta[N],Pow[N<<1],dep[N],vis[N];
void Add(int u,int v,int i) {
	vet[++edgenum]=v; nxt[edgenum]=head[u]; head[u]=edgenum; id[edgenum]=i;
}
void dfs(int x,int fa) {
	vis[x]=1,dep[x]=dep[fa]+1;
	for (int e=head[x]; e; e=nxt[e]) {
		int v=vet[e]; if (v==fa) continue;
		if (vis[v]) { flag[id[e]]=1; continue; }
		dfs(v,x); E[x].pb(v);
	}
}
void dfs2(int x) {
	for (int v: E[x]) dfs2(v),cnt[x]+=cnt[v];
	if (cnt[x]==0) gg[x]=1;
}
void dfs3(int x) {
	for (int v: E[x]) {
		if (gg[v]) ID[v]=++node;
		else ID[v]=ID[x];
		dfs3(v);	
	}
}
void dfs4(int x,int fa) {
	//cerr<<x<<' '<<sz[x]<<endl;
	f[x][0]=1;
	f[x][1]=Pow[sz[x]];
	for (int v: G[x]) {
		if (v==fa) continue;
		dfs4(v,x);
		f[x][0]=2ll*f[v][0]%mod*f[x][0]%mod;
		f[x][1]=1ll*(2ll*f[v][0]+f[v][1])*f[x][1]%mod;
	}
	int top=0;
	for (int v: G[x]) {
		if (v==fa) continue;
		sta[++top]=v;
	}
	Pre[0]=1; for (int i=1; i<=top; i++) Pre[i]=2ll*Pre[i-1]*f[sta[i]][0]%mod;
	Suf[top+1]=1; for (int i=top; i>=1; i--) Suf[i]=2ll*Suf[i+1]*f[sta[i]][0]%mod;
	f[x][1]=(f[x][1]-f[x][0]+mod)%mod;
	
	f[x][2]=f[x][1];
	for (int i=1; i<=top; i++) f[x][2]=(f[x][2]-1ll*Pre[i-1]*Suf[i+1]%mod*f[sta[i]][1]%mod+mod)%mod;
	
	for (int i=1; i<=top; i++) f[x][2]=(2ll*Pre[i-1]*Suf[i+1]%mod*f[sta[i]][2]%mod+f[x][2])%mod;
	//cerr<<f[x][0]<<' '<<f[x][1]<<' '<<f[x][2]<<endl;
}

int main() {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
	for (int i=1; i<=m; i++) {
		scanf("%d%d",&U[i],&V[i]);
		Add(U[i],V[i],i),Add(V[i],U[i],i);
	}
	dfs(1,0);
	for (int i=1; i<=m; i++)
		if (flag[i]) {
			if (dep[U[i]]<dep[V[i]]) swap(U[i],V[i]);
			cnt[U[i]]++,cnt[V[i]]--;
		}
	ID[1]=node=1; dfs2(1);
	dfs3(1); int tot=0;
	for (int i=1; i<=n; i++) {
		sz[ID[i]]++;
		for (int e=head[i]; e; e=nxt[e]) {
			int v=vet[e];
			if (ID[v]!=ID[i]) {
				if (!Map[make_pair(ID[v],ID[i])]) {
					G[ID[v]].pb(ID[i]);
					G[ID[i]].pb(ID[v]);
					Map[make_pair(ID[v],ID[i])]=1;
					Map[make_pair(ID[i],ID[v])]=1;
					tot++;
				}
				continue;
			}
			edge[ID[i]]++;
		}
	}
	//cerr<<node<<endl;
	//int sum=0; for (int i=1; i<=node; i++) sum+=sz[i];
	//cerr<<sum<<' '<<n<<endl;
	//for (int i=1; i<=node; i++) for (int v: G[i]) if (v<i) cerr<<v<<' '<<i<<endl;
	for (int i=1; i<=node; i++) edge[i]>>=1;
	Pow[0]=1; for (int i=1; i<=m; i++) Pow[i]=1ll*Pow[i-1]*2%mod;
	dfs4(1,0);
	for (int i=1; i<=node; i++) f[1][2]=1ll*f[1][2]*Pow[edge[i]]%mod;
	printf("%d\n",f[1][2]);
}
