#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const int M = 1e6 + 10;
const long long MOD = 1e9 + 7;
struct bian{int from, to, flag;}eg[M << 1], eg1[M << 1];
int front[N], num;
void add(int x, int y)
{
	eg[++ num] = (bian){front[x], y};
	front[x] = num;
}


int front1[N], num1;
void add1(int x, int y)
{
	eg1[++ num1] = (bian){front1[x], y};
	front1[x] = num1;
}

int dfn[N], low[N], n, m;
int dfs(int o, int from)
{
	dfn[o] = low[o] = ++ num;
	for (int i = front[o]; i; i = eg[i].from)
	{
		int to = eg[i].to;
		if(dfn[to] == 0)
		{
			low[o] = min(low[o], dfs(to, o));
			if(low[to] > dfn[o]) eg[i].flag = eg[((i - 1) ^ 1) + 1].flag = 1;
		}
		else if(to != from)
			low[o] = min(low[o], dfn[to]);
	}
	return low[o];
}
int col[N], siz[N], sizeg[N];
long long pw[M];

void dfs1(int o)
{
	col[o] = num;
	++ siz[num];
	for (int i = front[o]; i; i = eg[i].from)
	{
		int to = eg[i].to;
		if(eg[i].flag || col[to]) continue;
		dfs1(to);
	}
}

long long dp[N], ans;
void dfs2(int o, int from)
{
	long long pr = 0, qzh = 0;
	for (int i = front1[o]; i; i = eg1[i].from)
	{
		int to = eg1[i].to;
		if(to == from) continue;
		dfs2(to, o);
		sizeg[o] += sizeg[to] + 1;
	}
	for (int i = front1[o]; i; i = eg1[i].from)
	{
		int to = eg1[i].to;
		if(to == from) continue;
		pr += sizeg[to] + 1;
		(dp[o] += qzh * dp[to] % MOD * pw[sizeg[o] - pr] % MOD * pw[siz[o]]) %= MOD;
		(dp[o] += dp[to] * pw[sizeg[o] - (sizeg[to] + 1)] % MOD * (pw[siz[o]] - 1)) %= MOD;
		qzh = (dp[to] * pw[pr - (sizeg[to] + 1)] % MOD + qzh * (dp[to] + pw[sizeg[to] + 1]) % MOD) % MOD;
	}
	(dp[o] += pw[sizeg[o]] * (pw[siz[o]] - 1)) %= MOD;
	(ans += dp[o] * pw[m - sizeg[o]] % MOD) %= MOD;
	
	for (int i = front1[o]; i; i = eg1[i].from)
	{
		int to = eg1[i].to;
		if(to == from) continue;
		(dp[o] += dp[to] * pw[sizeg[o] - (sizeg[to] + 1)]) %= MOD;
	}
}
int main()
{
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin >> n >> m;
	pw[0] = 1;
	for (int i = 1; i <= m; ++ i) pw[i] = (pw[i - 1] * 2) % MOD;
	for (int i = 1; i <= m; ++ i)
	{
		int x, y;
		cin >> x >> y;
		add(x, y); add(y, x);
	}
	num = 0;
	dfs(1, 0);
	num = 0;
	for (int i = 1; i <= n; ++ i) if(col[i] == 0) ++ num, dfs1(i);
	num = 0;
	for (int o = 1; o <= n; ++ o)
	{
		for (int i = front[o]; i; i = eg[i].from)
		{
			int to = eg[i].to;
			if(col[o] != col[to]) add1(col[o], col[to]);
			else if(o < to) ++ sizeg[col[o]];
		}
	}
	dfs2(1, 0);
	cout << ans;
}