#include<bits/stdc++.h>
#define M 1000010
#define N 500010
using namespace std;
typedef long long ll;
const ll mod=1000000007;
inline ll rl(){
	ll ans=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9')ans=ans*10+c-'0',c=getchar();
	return ans*f;
}
ll head[M<<1],nxt[M<<1],to[M<<1],cnt=1;
bool v[M<<1];
void ade(ll u,ll v){
	cnt++;
	nxt[cnt]=head[u],to[cnt]=v;
	head[u]=cnt;
}
ll dfn[N],low[N],tot;
ll st[N],h,sum,col[N],w[N],e[N];
void tj(ll x){
	dfn[x]=low[x]=++tot;
	st[++h]=x;
	ll y;
	for(ll i=head[x];i;i=nxt[i]){
		if(v[i])continue;
		v[i]=v[i^1]=1;
		y=to[i];
		if(!dfn[y]){
			tj(y);
			low[x]=min(low[x],low[y]);
		}else low[x]=min(low[x],dfn[y]);
	}
	if(dfn[x]==low[x]){
		sum++;
		do{
			y=st[h--];
			col[y]=sum;
			w[sum]++;
		}while(y!=x&&h);
	}
}
ll hd[N<<1],nx[N<<1],td[N<<1],cot;
void add(ll u,ll v){
	nx[++cot]=hd[u],td[cot]=v;
	hd[u]=cot;
}
ll n,pw[M];
void init(){//pow(2,k)
	pw[0]=1;
	for(ll i=1;i<=n;i++)pw[i]=(pw[i-1]<<1)%mod;
}
ll f[N][4],dep[N];
bool vis[N];
void dp(ll x){
	vis[x]=1;
	f[x][0]=pw[e[x]];
	f[x][1]=(pw[w[x]]-1)*pw[e[x]]%mod;
	f[x][2]=f[x][3]=0;
	ll y,len=0;
	for(ll i=hd[x];i;i=nx[i]){
		y=td[i];
		if(vis[y])continue;
		dp(y);
		len++;
		
		f[x][0]=f[x][0]*f[y][0]*2%mod;
		f[x][1]=f[x][1]*(f[y][0]*2+f[y][1]+f[y][2])%mod;
		
		if(!f[x][2])f[x][2]=pw[e[x]];
		f[x][2]=f[x][2]*(f[y][1]+f[y][2])%mod;
		
		if(!f[x][3])f[x][3]=pw[e[x]];
		f[x][3]=f[x][3]*(f[y][1]+f[y][2]+f[y][3]*2)%mod;
	}
}
ll m,a,b;
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=rl(),m=rl();
	for(ll i=1;i<=m;i++){
		a=rl(),b=rl();
		ade(a,b),ade(b,a);
	}
	tj(1);
	ll y;
	for(ll x=1;x<=n;x++){
		for(ll i=head[x];i;i=nxt[i]){
			y=to[i];
			if(col[x]==col[y]){
				e[col[x]]+=x<y;
				continue;
			}
			add(col[x],col[y]);
			add(col[y],col[x]);
		}
	}
	init();
	dp(1);
	printf("%lld\n",(f[1][1]+f[1][2]+f[1][3])%mod);
	return 0;
}
