#include <bits/stdc++.h>

typedef long long ll;
const int MOD = 1e9 + 7;
const int N = 1e6 + 10;

ll pow2[N];
void init() {
	pow2[0] = 1;
	for (int i = 1; i < N; ++i) {
		pow2[i] = pow2[i - 1] * 2 % MOD;
	}
	return;
}

std::vector<int> e[N], T[N];

int dfn[N], low[N], num;
int sta[N], top;
int ecc[N], sz[N], cnt;
void tarjan(int x, int fa) {
	dfn[x] = low[x] = ++num;
	sta[++top] = x;
	for (auto t : e[x]) {
		if (t == fa) continue;
		if (!dfn[t]) {
			tarjan(t, x);
			if (low[t] < low[x]) low[x] = low[t];
		}
		else if (dfn[t] < low[x]) low[x] = dfn[t];
	}
	if (dfn[x] == low[x]) {
		++cnt;
		int y;
		do {
			y = sta[top--];
			ecc[y] = cnt;
			++sz[cnt];
		} while (y != x);
	}
	return;
}

ll f[N], g[N], h[N];
void dp(int x, int fa) {
	f[x] = 1, g[x] = 1;
	for (auto t : T[x]) {
		if (t == fa) continue;
		dp(t, x);
		f[x] = f[x] * (f[t] * 2) % MOD;
		g[x] = g[x] * (f[t] * 2 + g[t]) % MOD;
		h[x] = (h[x] + h[t] * 2) % MOD;
	}
	h[x] = (h[x] + g[x] * (pow2[sz[x]] - 1)) % MOD;
	g[x] = (g[x] * pow2[sz[x]] - f[x] + MOD) % MOD;
	return;
}
int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out"," w", stdout);

	init();
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; ++i) {
		int u, v;
		scanf("%d%d", &u, &v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	tarjan(1, 0);
	for (int x = 1; x <= n; ++x) {
		for (auto t : e[x]) {
			if (ecc[x] != ecc[t]) {
				T[ecc[x]].push_back(ecc[t]);
			}
		}
	}
	dp(1, 0);
	printf("%lld\n", h[1] * pow2[m - cnt + 1] % MOD);
	return 0;
}