//bruteforce
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mkp make_pair
#define fi first
#define se second
#define ls(x) ((x)<<1)
#define rs(x) ((x)<<1|1)
const int mod = 1e9 + 7, N = 5e6 + 10, M = 1e6 + 10;
int n, m;
int fa[N], tmp[N];
pair<int, int> ed[M];
int find(int x) {
	return (x == fa[x]) ? x : fa[x] = find(fa[x]);
}
pair<int, int> calc(int x) {
	pair<int, int> ret;
	for(int i = 1; i <= n; i++) fa[i] = i, tmp[i] = 0;
	for(int i = 1; i <= m; i++) {
		if(x == i) continue;
		int u = find(ed[i].fi), v = find(ed[i].se);
		if(u != v) fa[u] = v; 
	}
	for(int i = 1; i <= n; i++)
		tmp[find(i)] |= (1 << (i - 1));
	for(int i = 1; i <= n; i++)
		if(find(i) == i) {
			if(!ret.fi) ret.fi = tmp[i];
			else ret.se = tmp[i];
		}
	return ret;
}
void bf() {
	int ans = 0;
	for(int i = 1; i < (1 << n); i++) {
		int qwq = 1;
		for(int j = 1; j <= m; j++) {
			pair<int, int> t = calc(j);
			if((t.fi & i) && (t.se & i)) ;
			else qwq = ((ll)qwq * 2) % mod;
		}
		ans += qwq; if(ans >= mod) ans -= mod;
	}
	printf("%d\n", ans);
	return;
}
int pre[M];
void subtask() {
	pre[0] = 1;
	for(int i = 1; i <= m; i++) pre[i] = 2ll * pre[i - 1] % mod;
	int ans = 0;
	for(int i = 0; i <= n - 1; i++)  {
		if(i == 0) ans = (ans + (ll)pre[n - 1 - i] * (n - i) % mod) % mod;
		else ans = (ans + (ll)pre[n - 1 - i] * pre[i - 1] % mod * (n - i) % mod) % mod;
	}
	printf("%d\n", ans);
}
int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= m; i++)
		scanf("%d%d", &ed[i].fi, &ed[i].se);
	if(n <= 16 && m <= 25) bf();
	else subtask();
	return 0;
}
/*
数数不给树的大样例。
*/