#include<iostream>
#include<vector>
#include<algorithm>
constexpr const int p = 1e9 + 7;
inline int maintain(int x) { return x >= p ? x - p : x; }
inline int plus(int x, int y) { return maintain(x + y); }
inline int minus(int x, int y) { return maintain(x - y + p); }
inline int mul(int x, int y) { return 1ll * x * y % p; }
std::vector<int> e[500005], E[500005];
int n, m, dfn[500005], cnt, sta[500005], top, bel[500005], tot, w[500005], low[500005];
void tarjan(int u, int fa) {
	dfn[u] = low[u] = ++cnt, sta[++top] = u;
	for (int v : E[u]) {
		if (v == fa) continue;
		if (!dfn[v]) {
			tarjan(v, u), low[u] = std::min(low[u], low[v]);
			if (low[v] > dfn[u]) {
				tot++; int w;
				do {
					w = sta[top--], bel[w] = tot;
				} while (w != v);
			}
		} else low[u] = std::min(low[u], dfn[v]);
	}
	if (fa == 0) {
		tot++;
		for (int i = 1; i <= top; i++) bel[sta[i]] = tot;
	}
}
int f[500005], siz[500005], p2[1000006], g[500005];
void dfs(int u, int fa) {
	f[u] = p2[w[u]], siz[u] = 1;
	for (int v : e[u]) {
		if (v == fa) continue;
		dfs(v, u);
		f[u] = mul(f[u], plus(p2[siz[v] - 1], f[v]));
		siz[u] += siz[v];
	}
	g[u] = f[u];
	for (int v : e[u]) {
		if (v == fa) continue;
		g[u] = plus(g[u], plus(mul(p2[siz[u] - siz[v] - 1], minus(g[v], p2[siz[v] - 1])), minus(g[v], f[v])));
	}
//	std::cerr << f[u] << ' ' << g[u] << '\n';
}
int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
	std::cin >> n >> m;
	p2[0] = 1;
	for (int i = 1; i <= m; i++) p2[i] = plus(p2[i - 1], p2[i - 1]);
	for (int i = 1; i <= m; i++) {
		int u, v; std::cin >> u >> v;
		E[u].push_back(v), E[v].push_back(u);
	}
	tarjan(1, 0);
	for (int i = 1; i <= n; i++) w[bel[i]]++;
	int t = 0;
	for (int i = 1; i <= n; i++) {
		for (int j : E[i]) {
			if (bel[j] != bel[i]) e[bel[i]].push_back(bel[j]);
			else t++;
		}
	}
	t /= 2, dfs(1, 0);
	std::cout << mul(p2[t], minus(g[1], p2[siz[1] - 1])) << '\n';
}
