
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline ll read(){
	ll x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x*f;
}
const ll N=1000010,M=500010,mod=1000000007,G=-1;
ll qpow(ll x,ll y){
	ll z=1;
	for(;y;y>>=1){
		if(y&1)z=z*x%mod;
		x=x*x%mod;
	}
	return z;
}
ll n,m,a[M],b[M],f[M][2],g[M];
ll dfn[M],low[M],num,brg[N<<1],cnt,c[M];
ll head[N],nxt[N<<1],ver[N<<1],tot=1;
void add(ll x,ll y){ver[++tot]=y,nxt[tot]=head[x],head[x]=tot;}
ll hc[N],pc[N<<1],vc[N<<1],tc;
void addc(ll x,ll y){vc[++tc]=y,pc[tc]=hc[x],hc[x]=tc;}
struct E{ll x,y;}e[N];
void tarjan(ll x,ll p){
	dfn[x]=low[x]=++num;
	for(ll i=head[x];i;i=nxt[i]){
		ll y=ver[i];
		if(!dfn[y]){
			tarjan(y,x),low[x]=min(low[x],low[y]);
			if(dfn[x]<low[y])brg[i]=brg[i^1]=1;
		}
		else if(y!=p)low[x]=min(low[x],dfn[y]);
		
	}
}
void dfs0(ll x){
	c[x]=cnt,a[cnt]++;
	for(ll i=head[x];i;i=nxt[i]){
		ll y=ver[i];
		if(!brg[i])b[cnt]++;
		if(c[y]||brg[i])continue;
		dfs0(y);
	}
}
void dfs(ll x,ll fa){
	f[x][0]=qpow(2,b[x]);
	g[x]=f[x][1]=(qpow(2,a[x])-1+mod)%mod*f[x][0]%mod;
	for(ll i=hc[x];i;i=pc[i]){
		ll y=vc[i];
		if(y==fa)continue;
		dfs(y,x);
		f[x][1]=f[y][0]*2%mod*f[x][1]%mod;
		f[x][1]=(f[x][1]+f[x][0]*f[y][1]%mod*2%mod)%mod;
		f[x][1]=(f[x][1]+g[x]*g[y]%mod)%mod;
		g[x]=(f[y][0]*2%mod+g[y])%mod*g[x]%mod;
		f[x][0]=f[x][0]*f[y][0]%mod*2%mod;
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	for(ll i=1,x,y;i<=m;i++)
		x=read(),y=read(),add(x,y),add(y,x),
		e[i].x=x,e[i].y=y;
	for(ll i=1;i<=n;i++)if(!dfn[i])tarjan(i,0);
	for(ll i=1;i<=n;i++)if(!c[i])cnt++,dfs0(i);
	for(ll i=1;i<=cnt;i++)b[i]>>=1;
	for(ll i=1;i<=m;i++)
		if(c[e[i].x]!=c[e[i].y])
			addc(c[e[i].x],c[e[i].y]);
	dfs(c[1],0);
	printf("%lld\n",f[c[1]][1]);
	return 0;
}