#include<bits/stdc++.h>
using namespace std;

const int p = 1000000007;
int qpow(int a, int k) {
	int ans = 1;
	while (k) {
		if (k & 1) ans = 1LL * ans * a % p;
		a = 1LL * a * a % p;
		k >>= 1;
	}
	return ans;
}
const int maxn = 500005;
int n, m;
vector<int> G[maxn];

int p2[maxn << 1];

int inline read() {
	int x = 0; char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
	return x;
}

int fa[maxn];
int DFN[maxn], LOW[maxn], idx;
int clr[maxn], siz[maxn], tot;
int stk[maxn], len;
void Tarjan(int x, int f) {
	fa[x] = f;
	DFN[x] = LOW[x] = ++idx;
	stk[++len] = x;
	for (int y : G[x]) if (y != f)
		if (DFN[y])
			LOW[x] = min(LOW[x], DFN[y]);
		else
			Tarjan(y, x), LOW[x] = min(LOW[x], LOW[y]);
	if (DFN[x] == LOW[x]) {
		tot++;
		while (stk[len + 1] != x)
			clr[stk[len--]] = tot,
			siz[tot]++;
	}
}

vector<int> H[maxn];
int F[maxn], ans; // F[x] : x zai lian tong kuai li, qie sum_node >= 1
				  // x ben shen ke yi bu xuan, dan shi shi lian tong kuai de zui gao dian
int F00[maxn];
int siz_[maxn];
void solve(int x) {
	F[x] = p2[siz[x]] - 1;
	F00[x] = 1;
	siz_[x] = 1;
	for (int y : H[x]) {
		solve(y);
		F[x] = (1LL * F[x] * F00[y] // bu bao (x, y)
			+ 1LL * F[x] * F[y] // bao (x, y), dou you dian
			+ 1LL * F[x] * F00[y] // bao (x, y), x you dian, y kong lian
			+ 1LL * F[y] * F00[x]) % p; // bao (x, y), y you dian, x kong lian
//		F0[x] = 1LL * F0[x] * (F0[y] + F00[y]) % p;
		F00[x] = 2LL * F00[x] * F00[y] % p;
		siz_[x] += siz_[y];
	}
	ans = (ans + 1LL * F[x] * p2[max(0, tot - 1 - siz_[x])]) % p;
}

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++) p2[i] = (p2[i - 1] + p2[i - 1]) % p;
	for (int i = 1; i <= m; i++) {
		int u = read(), v = read(); // scanf("%d%d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
	}
	Tarjan(1, 0);
	
	int X = p2[m - tot + 1]; // fei ge bian sui yi
	for (int i = 2; i <= n; i++)
		if (clr[i] != clr[fa[i]])
			H[clr[fa[i]]].push_back(clr[i]);
	
	solve(clr[1]);
	printf("%lld\n", 1LL * ans * X % p);
}