#include<bits/stdc++.h>
#define ll long long
template <typename T> void read(T &x){
	T sign=1,sum=0;
	char c=getchar();
	while (!isdigit(c)){
		if (c=='-'){
			sign=-1;
		}
		c=getchar();
	}
	while (isdigit(c)){
		sum=(sum<<1)+(sum<<3)+c-'0';
		c=getchar();
	}
	x=sign*sum;
}
const ll mod=1e9+7;
const int N=3e6+500;
struct EDGE{
	int to,nxt;
}EDGE[N];
int Head[N],tot1=0;
void add_EDGE(int u,int v){
	++tot1;
	EDGE[tot1].to=v;
	EDGE[tot1].nxt=Head[u];
	Head[u]=tot1;
}
ll quick_pow(ll base,ll tim){
	ll res=1;
	while (tim){
		if (tim&1){
			res=res*base%mod;
		}
		base=base*base%mod;
		tim>>=1;
	}
	return res;
}
int n;
int m;
int dfn[N],low[N];
int belong[N],num=0;
ll Size[N];
int cntz=0;
int s[N],top=0;
std::vector<int> e[N];
struct Edge{
	int u,v;
}E[N];
void dfs(int u,int fa){
	dfn[u]=low[u]=++cntz;
	s[++top]=u;
	for (int v:e[u]){
		if (fa!=v&&!dfn[v]){
			dfs(v,u);
		}
		if (fa!=v){
			low[u]=std::min(low[u],low[v]);
		}
	}
	if (low[u]==dfn[u]){
		++num;
		belong[u]=num;
		++Size[num];
		while (top>1&&s[top]!=u){
			belong[s[top]]=num;
			++Size[num];
			--top;
		}
		--top;
	}
	return ;
}
struct edge{
	int to;
	int nxt;
}edge[N];
int head[N];
void add_edge(int u,int v){
	static int tot=0;
	++tot;
	edge[tot].to=v;
	edge[tot].nxt=head[u];
	head[u]=tot;
}
ll ans=0;
ll f[N][3];
void dfs2(int u,int fa){
	f[u][0]=1ll;
	ll res=1ll;
	for (int i=head[u];i;i=edge[i].nxt){
		int v=edge[i].to;
		if (v==fa){
			continue;
		}
		dfs2(v,u);
		f[u][0]=f[u][0]*2ll*f[v][0]%mod;
		res=res*((f[v][1]+(f[v][0]*2ll))%mod)%mod;
		res%=mod;
	}
	for (int i=head[u];i;i=edge[i].nxt){
		int v=edge[i].to;
		if (v==fa){
			continue;
		}
		f[u][2]+=((f[u][0]*quick_pow(2*f[v][0]%mod,mod-2)%mod)*(f[v][1]))%mod;
		f[u][2]+=((f[u][0]*quick_pow(f[v][0]%mod,mod-2)%mod)*(f[v][2]))%mod;
		f[u][2]%=mod;
	}
	f[u][0]%=mod;
	f[u][1]+=(quick_pow(2ll,Size[u])*res%mod)-f[u][0];
	f[u][1]%=mod;
	f[u][1]=(f[u][1]+mod)%mod;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	read(n),read(m);
	for (int i=1;i<=m;++i){
		int u,v;
		read(u),read(v);
		e[u].push_back(v);
		e[v].push_back(u);
		E[i]=(Edge){u,v};
	}
	dfs(1,0);
	ll res=1;
	for (int i=1;i<=m;++i){
		int u=E[i].u,v=E[i].v;
		if (belong[u]==belong[v]){
			res=res*2ll%mod;
		}
		else{
			add_edge(belong[u],belong[v]);
			add_edge(belong[v],belong[u]);
		}
	}
	dfs2(1,0);
	printf("%lld\n",((res*f[1][1]%mod)+(res*f[1][2]%mod))%mod);
	return 0;
}