#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);++(i))
#define per(i,a,b) for(int (i)=(a);(i)>=(b);--(i))
using namespace std;
inline int read()
{
	int f=1,x=0; char c=getchar();
	while(!isdigit(c)) f=c=='-'?-1:1,c=getchar();
	while(isdigit(c)) x=(x<<3)+(x<<1)+(c-'0'),c=getchar();
	return f*x;
}
inline void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10+'0');
	return void();
}
const int N=2e6+520,mod=1e9+7;
inline int Pow(int x,int y)
{
	int res=1;
	for(;y;y>>=1)
	{
		if(y&1) res=res*x%mod;
		x=x*x%mod;
	}
	return res;
}
int n,m,dfn[N],low[N],tot,belong[N],val[N],siz[N];
vector<int> vt[N];
bool vis[N];
int q[N],cnt,k;
inline void add(int x,int y){return vt[x].push_back(y),vt[y].push_back(x),void();}
inline void tarjan(int x,int fa)
{
	dfn[x]=low[x]=++k;
	q[++cnt]=x;
	for(auto y:vt[x])
	{
		if(y==fa) continue;
		if(!dfn[y]) tarjan(y,x),low[x]=min(low[x],low[y]);
		else low[x]=min(low[x],low[y]);
	}
	if(dfn[x]==low[x])
	{
		++tot;
		while(q[cnt]!=x)
		{
			belong[q[cnt]]=tot;
			--cnt;
		}
		belong[x]=tot;
		--cnt;
	}
	return void();
}
vector<int> S[N];
int f[N][3];
inline void dfs(int x,int fa)
{
	//cout<<x<<' '<<fa<<endl;
	f[x][1]=(Pow(2,siz[x])-1+mod)%mod,f[x][0]=1;
	int res=1,son=0;
	for(auto y:S[x])
	{
		if(y==fa) continue;
		dfs(y,x);
		++son;
		res=(res*f[y][0]*2%mod+res*f[y][1]%mod);
		f[x][1]=(f[x][1]*f[y][1]%mod+f[x][1]*f[y][0]%mod*2%mod)%mod;
		f[x][0]=f[x][0]*f[y][0]%mod*2%mod;
	}
	//if(x==belong[1]) cout<<res-f[x][0]<<endl;
	for(auto y:S[x])
	{
		if(y==fa) continue;
		res=(res+f[x][0]*Pow(2*f[y][0]%mod,mod-2)%mod*f[y][1]%mod)%mod;
	}
	//if(x==belong[1])
	//cout<<f[x][1]<<' '<<res<<endl;
	if(son) f[x][1]=(res+f[x][1]-f[x][0]+mod)%mod;
	return void();
}
signed main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
    n=read(),m=read();
    rep(i,1,m) add(read(),read());
    tarjan(1,0);
    rep(x,1,n) ++siz[belong[x]];
    rep(x,1,n) for(auto y:vt[x])
	if(belong[x]!=belong[y]) S[belong[x]].push_back(belong[y]);
	int rt=1;
	rep(i,1,tot) if(S[i].size()>=2) rt=i;
    dfs(rt,0);
    //cout<<m-tot+1<<endl;
    write(f[rt][1]*Pow(2,m-tot+1)%mod);
	return 0;
}
/*
2 1
1 2
*/
/*
4 4
1 2
2 3
3 1
1 4
*/