#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef pair <int, int> pii;
const int N = 2e6 + 6;
int n, m, P2[N], u, v, cnt, sz[N], bid[N], stk[N], top, dfn[N], low[N], TIME, siz[N], w[N], dp[N], ans, ecnt; pii edge[N];
basic_string <int> adj[500005];
int edgenum, Head[N], Next[N], vet[N];
inline int PLUS(int x, int y) { return (x += y) >= MOD ? x - MOD : x; }
int read() {
	int s = 0; char ch = getchar();
	while (! isdigit(ch)) ch = getchar();
	while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
	return s;
}
void add(int u, int v) {
	Next[++edgenum] = Head[u];
	Head[u] = edgenum;
	vet[edgenum] = v;
}
void Tarjan(int u, int fa) {
	dfn[u] = low[u] = ++ TIME, stk[++top] = u;
	for (int v : adj[u]) if (v ^ fa) {
		if (! dfn[v]) Tarjan(v, u), low[u] = min(low[u], low[v]);
		else low[u] = min(low[u], dfn[v]);
	}
	if (dfn[u] == low[u]) {
		++ cnt;
		do sz[cnt] ++, bid[stk[top]] = cnt;
		while (stk[top--] ^ u); w[cnt] = P2[sz[cnt]] - 1;
	}
}
void dfs(int u, int fa) {
	int f[3] {1, 0, 0}; siz[u] = 1;
	for (int e=Head[u]; e; e=Next[e]) {
		int v=vet[e];
		if (v == fa) continue;
		dfs(v, u), siz[u] += siz[v];
		f[2] = (1ll * f[1] * dp[v] + 1ll * f[2] * (dp[v] + P2[siz[v]])) % MOD;
		f[1] = (1ll * f[0] * dp[v] + 1ll * f[1] * P2[siz[v]]) % MOD;
		f[0] = 1ll * f[0] * P2[siz[v]] % MOD;
	}
	ans = (ans + 1ll * P2[cnt-siz[u]] * ((1ll * w[u] * (f[0] + f[1]) + 1ll * (w[u] + 1) * f[2]) % MOD)) % MOD;
	dp[u] = (1ll * w[u] * f[0] + 1ll * (w[u] + 1) * (f[1] + f[2])) % MOD;
}
int main() {
	freopen ("barrack.in", "r", stdin);
	freopen ("barrack.out", "w", stdout);
	n = read(), m = read(), P2[0] = 1;
	for (int i=1; i<=m; i++)
		u = read(), v = read(), adj[u] += v, adj[v] += u, P2[i] = PLUS(P2[i-1], P2[i-1]);
	Tarjan(1, 0);
	for (int i=1; i<=n; i++)
		for (int j : adj[i])
			if (bid[i] ^ bid[j])
				edge[++ecnt] = pii (bid[i], bid[j]);
	sort (edge+1, edge+ecnt+1), ecnt = unique (edge+1, edge+ecnt+1) - edge - 1;
	for (int i=1; i<=ecnt; i++)
		add(edge[i]. first, edge[i]. second);
	dfs(1, 0), cout << 1ll * ans * P2[m-cnt+1] % MOD << endl;
}