#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 500005, M = 1000005, mod = 1e9 + 7;
int n, m;
int head[N], ver[M*2], nxt[M*2], cnt;
int pw[N];

void add(int u, int v) {
	ver[++cnt] = v, nxt[cnt] = head[u], head[u] = cnt;
}

void Add(int &a, int b) {
	a += b;
	if (a >= mod) a -= mod;
}

int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%d%d", &n, &m);
	for (int i = 1, u, v; i <= m; ++i) scanf("%d%d", &u, &v), add(u, v), add(v, u);
	pw[0] = 1;
	for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * 2 % mod;
	int ans = 0;
	Add(ans, 1ll * pw[n - 1] * n % mod);
	for (int i = 1; i < n; ++i) Add(ans, 1ll * pw[n - 2] * (n - i) % mod);
	printf("%d", ans);
	fclose(stdin); fclose(stdout);
	return 0;
}
