#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
ll read()
{
	ll x=0,f=1;
	char ch = getchar();
	while (ch > '9' || ch < '0')
		{
			if (ch == '-')
				f = -1;
			ch = getchar();
		}
	while (ch <= '9' && ch >= '0')
		{
			x = x*10+ch-'0';
			ch = getchar();
		}
	return x*f;
}
void write(ll x)
{
	if (x < 0)
		{
			putchar('-');
			x = -x;
		}
	if (x > 9)
		write(x/10);
	putchar(x%10+'0');
}
const ll mod = 1000000007;
ll n,m;
ll head[2001000],nnext[2001000],to[2001000],cnt;
ll dfn[2001000],low[2001000],dfs_clock;
ll dcc_cnt,belong_dcc[2001000],dcc_siz[2001000],dcc_edge[2001000];
ll dcc_head[2001000],dcc_nnext[2001000],dcc_to[2001000],dcccnt;
ll f[2000100][2],ans,du[2001000],fa[2001000];
//i -> which node
//j -> if the node and son trees set barrack
stack<ll> s;
void add(ll u,ll v)
{
	++cnt;
	nnext[cnt] = head[u];
	head[u] = cnt;
	to[cnt] = v;
}
void dcc_add(ll u,ll v)
{
	++dcccnt;
	dcc_nnext[dcccnt] = dcc_head[u];
	dcc_head[u] = dcccnt;
	dcc_to[dcccnt] = v;
}
void Tarjan(ll x,ll last_edge)
{
	++dfs_clock;
	dfn[x] = dfs_clock;
	low[x] = dfs_clock;
	s.push(x);
	for (int i=head[x];i;i=nnext[i])
		{
			ll y = to[i];
			if (!dfn[y])
				{
					Tarjan(y,i);
					low[x] = min(low[x],low[y]);
				}
			else if ((i^1) != last_edge)
				low[x] = min(low[x],dfn[y]);
		}
	if (low[x] == dfn[x])
		{
			ll temp = -1;
			++dcc_cnt;
			while (temp != x)
				{
					temp = s.top();
					s.pop();
					belong_dcc[temp] = dcc_cnt;
					++dcc_siz[dcc_cnt];
				}
		}
}
ll fastpow(ll x)
{
	if (x == 0)
		return 1;
	ll base = 2;
	ll tot = 1;
	while (x > 0)
		{
			if (x & 1)
				{
					tot *= base;
					tot %= mod;
				}
			base *= base;
			base %= mod;
			x >>= 1;
		}
	return tot;
}
void dfs(ll x,ll fath)
{
	fa[x] = fath;
	for (int i=dcc_head[x];i;i=dcc_nnext[i])
		{
			ll y = dcc_to[i];
			if (y == fath)
				continue;
			f[y][0] *= f[x][0]*2;
			f[y][0] %= mod;
			f[y][1] *= f[x][1]+f[x][0]*2;
			f[y][1] %= mod;
			dfs(y,x);
		}
}
int main()
{
	//freopen("barrack_sam.in","r",stdin);
	
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	
	n = read();
	m = read();
	cnt = 1;
	for (int i=1;i<=m;++i)
		{
			int a,b;
			a = read();
			b = read();
			add(a,b);
			add(b,a);
		}
	Tarjan(1,0);
	ll temp = 0;
	for (int i=1;i<=n;++i)
		for (int j=head[i];j;j=nnext[j])
			{
				ll k = to[j];
				if (belong_dcc[i] == belong_dcc[k])
					++dcc_edge[belong_dcc[i]];
				else
					{
						dcc_add(belong_dcc[i],belong_dcc[k]);
						++du[belong_dcc[k]];
						++temp;
					}
			}
	temp /= 2;
	for (int i=1;i<=dcc_cnt;++i)
		dcc_edge[i] /= 2;
	for (int i=1;i<=dcc_cnt;++i)
		{
			f[i][0] = fastpow(dcc_edge[i]);
			f[i][1] = (fastpow(dcc_siz[i])-1)*fastpow(dcc_edge[i]);
			f[i][1] %= mod;
		}
	dfs(1,0);
	ans = 0;
	for (int i=1;i<=dcc_cnt;++i)
		{
			ans += f[i][1]+f[i][0];
			ans %= mod;
		}
	ans = (ans-fastpow(temp)+mod)%mod;
	printf("%lld",ans);
	return 0;
}
/*
4 4
1 2
2 3
3 1
1 4

3 2
1 2 
2 3

dcc_test
11 13
1 2
2 3
3 1
3 4
4 5
3 6
6 7
7 8
8 6
6 9
9 10
10 11
11 8

*/
