#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1e9+7;
inline LL add (LL x, LL y) {
	return (x + y) % MOD;
}
inline LL mul (LL x, LL y) {
	return x * y % MOD;
}
inline LL qpow (LL x, int y) {
	LL res = 1;
	while (y) {
		if (y&1)
			res = mul(res, x);
		x = mul(x, x);
		y >>= 1;
	}
	return res;
}
struct edge {
	int fr, to, nxt, tag;
}e[2000005];
int head[500005], ind = 1;
inline void Add (int u, int v) {
	e[++ind].to = v;
	e[ind].fr = u;
	e[ind].nxt = head[u];
	e[ind].tag = 0;
	head[u] = ind;
	return;
}
int dfn[500005], low[500005], cnt = 0;
void tarjan (int u, int par) {
	dfn[u] = ++cnt;
	low[u] = cnt;
	for (int i = head[u]; i; i = e[i].nxt) {
		int v = e[i].to;
		if (v == par)
			continue;
		if (!dfn[v]) {
			tarjan(v, u);
			if (low[v] > dfn[u]) {
				e[i].tag = e[i^1].tag = 1;
			}
			low[u] = min(low[u], low[v]);
		}else {
			low[u] = min(low[u], dfn[v]);
		}
	}
}
int bln[500005], sz[500005] = {0};
void paint (int u, int col) {
	bln[u] = col;
	sz[col]++;
	for (int i = head[u]; i; i = e[i].nxt) {
		int v = e[i].to;
		if (bln[v] || e[i].tag)
			continue;
		paint(v, col);
	}
	return;
}
int col = 0;
int szm[500005];
LL dp[500005], br[500005];
vector <int> g[500005];
void dfs (int u, int par) {
	for (int i = 0; i < g[u].size(); i++) {
		int v = g[u][i];
		if (v == par)
			continue;
		dfs(v, u);
		LL res = add(add(mul(dp[u], qpow(2ll, szm[v]+1)),
		mul(dp[v], qpow(2ll, szm[u]+1))), mul(br[v], br[u]));
		br[u] = add(add(mul(br[u], qpow(2ll, szm[v]+1)),
		mul(br[v], qpow(2ll, szm[u]))), mul(br[v], br[u]));
		szm[u] += szm[v] + 1;
		dp[u] = res;
	}
	return;
}
int main () {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	int n, m;
	scanf("%d%d", &n, &m);
	while (m--) {
		int u, v;
		scanf("%d%d", &u, &v);
		Add(u, v);
		Add(v, u);
	}
	tarjan(1, 0);
	for (int i = 1; i <= n; i++) {
		if (!bln[i]) {
			col++;
			paint(i, col);
		}
	}
	for (int i = 3; i <= ind; i += 2) {
		if (!e[i].tag) {
			szm[bln[e[i].to]]++;
		}else {
			g[bln[e[i].fr]].push_back(bln[e[i].to]);
			g[bln[e[i].to]].push_back(bln[e[i].fr]);
		}
	}
	for (int i = 1; i <= col; i++) {
		dp[i] = mul(qpow(2ll, szm[i]), qpow(2, sz[i]) - 1);
		br[i] = dp[i];
	}
	dfs(1, 0);
	/*for (int i = 2; i <= col; i++) {
		int u = q[i], v = q[i-1];
		br[u] = add(add(dp[u], mul(br[v], dp[u])), mul(br[v], qpow(2, szm[u])));
		dp[u] = add(add(mul(dp[u], qpow(2ll, szm[v]+1)),
		mul(dp[v], qpow(2ll, szm[u]+1))), mul(br[v], dp[u]));
		szm[u] += szm[v];
	}*/
	printf("%lld\n", (dp[1] % MOD + MOD) % MOD);
	return 0;
}
