#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const ll inv=(mod+1)/2;
const int N=5e5+5,M=2e6+5;
int n,m;
inline int read()
{
	char C=getchar();
	int ANS=0,F=1;
	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;
}
int t[M],nxt[M],h[M],cnt=1,num;
ll v[N];
inline void addedge(int x,int y)
{
	// cout << x << ' ' << y << endl;
	t[++cnt]=y;
	nxt[cnt]=h[x],h[x]=cnt;
}
namespace graph
{
	int t[M],nxt[M],h[M],cnt=1;
	inline void add(int x,int y)
	{
		t[++cnt]=y;
		nxt[cnt]=h[x],h[x]=cnt;
	}
	bool c[M];
	int dfn[N],low[N],tot,co[N];
	void tarjan(int u,int pre)
	{
		//cout << u << " " << tot << endl;
		++tot,dfn[u]=tot,low[u]=tot;
		for (int i=h[u];i;i=nxt[i])
		{
			if ((i^pre)==1) continue;
			if (!dfn[t[i]])
			{
				tarjan(t[i],i);
				low[u]=min(low[u],low[t[i]]);
				if (low[t[i]]>dfn[u]) c[i]=1,c[i^1]=1;
			}
			else low[u]=min(low[u],dfn[t[i]]);
		}
	}
	void dfs(int x)
	{
		co[x]=num;
		for (int i=h[x];i;i=nxt[i])
		{
			if (co[t[i]]) continue;
			if (c[i]) continue;
			dfs(t[i]);
		}
	}
	void work()
	{
		tarjan(1,0);
		for (int i=1;i<=n;i++) if (!co[i]) {num++;dfs(i);}
		for (int i=1;i<=n;i++)
		{
			v[co[i]]=v[co[i]]*2%mod;
			for (int j=h[i];j;j=nxt[j])
			{
				if (co[t[j]]!=co[i]) addedge(co[i],co[t[j]]);
			}
		}
	}
}
ll dp[N],w[N];
void dfs(int x,int f)
{
	ll res=v[x],sum=0;
	for (int i=h[x];i;i=nxt[i])
	{
		if (t[i]==f) continue;
		dfs(t[i],x);
		res=res*(1+inv*dp[t[i]]%mod)%mod;
		sum=(sum+inv*dp[t[i]]%mod)%mod;
	}
	w[x]=(res-1-sum+mod+mod)%mod;
	dp[x]=(w[x]+sum)%mod;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	for (int i=1;i<=n;i++) v[i]=1;
	for (int i=1;i<=m;i++)
	{
		int x=read(),y=read();
		graph::add(x,y),graph::add(y,x);
	}
	graph::work();
	dfs(1,0);
	ll ans=0;
	for (int i=1;i<=num;i++) ans=(ans+w[i])%mod;
	for (int i=1;i<=m;i++) ans=ans*2%mod;
	cout << ans;
	return 0;
}
