#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i) 
#define R(i, j, k) for(int i = (j); i >= (k); --i) 
#define ll long long 
#define vi vector < int > 
#define ull unsigned long long 
#define sz(a) ((int) (a).size())
#define me(a, x) memset(a, x, sizeof(a)) 
using namespace std;
const int N = 1e6 + 7, mod = 1e9 + 7;
int n, m, ns;
int a[N];
vi e[N], G[N];
int dfn[N], low[N], idt;
int stk[N], tp;
int cnt, cid[N], sz[N];
int pw[N];

void dfs(int x, int f) {
	dfn[x] = low[x] = ++idt, stk[++tp] = x;
	for(auto v : e[x]) if(v != f) {
		if(!dfn[v]) dfs(v, x), low[x] = min(low[x], low[v]);
		else low[x] = min(low[x], dfn[v]);
	}
	if(dfn[x] == low[x]) {
		++cnt;
		for(int u = 0; u != x; --tp) 
			assert(tp >= 0), u = stk[tp], cid[u] = cnt, ++sz[cnt];
	}
}

int dp[N][3];
int siz[N];

void solve(int x, int f) {
	siz[x] = 1;
	dp[x][0] = 1;
	dp[x][2] = pw[sz[x]] - 1;
	for(auto v : G[x]) if(v != f) {
		solve(v, x);
		siz[x] += siz[v];
		dp[v][0] = (ll) dp[v][0] * 2 % mod;
		int cur[3] = {0, 0, 0};
		L(a, 0, 2) 
			L(b, 0, 1) 
				(cur[min(a + b, 2)] += (ll) dp[x][a] * dp[v][b] % mod) %= mod;
		dp[x][0] = cur[0];
		dp[x][1] = cur[1];
		dp[x][2] = cur[2];
	}
	(ns += (ll) pw[cnt - siz[x]] * dp[x][2] % mod) %= mod;
	(dp[x][1] += dp[x][2]) %= mod;
	dp[x][2] = 0;
}

int xu[N], xv[N];
int main() {
//	return system("fc barrack.out barrack4.ans"), 0;
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	ios :: sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n >> m;
	pw[0] = 1;
	L(i, 1, m + 1) 
		pw[i] = (ll) pw[i - 1] * 2 % mod;
	L(i, 1, m) {
		cin >> xu[i] >> xv[i];
		e[xu[i]].emplace_back(xv[i]);
		e[xv[i]].emplace_back(xu[i]);
	}
	dfs(1, 0);
	
	L(i, 1, m) {
		if(cid[xu[i]] != cid[xv[i]]) {
			G[cid[xu[i]]].emplace_back(cid[xv[i]]);
			G[cid[xv[i]]].emplace_back(cid[xu[i]]);
		}
	}
	
	solve(1, 0);
	cout << (ll) ns * pw[m - (cnt - 1)] % mod << '\n';
	return 0;
}
