#include <bits/stdc++.h>

using namespace std;

#define Mod 1000000007

int read(){
	int AK = 1, IOI = 0;
	char ch = 0;
	while (ch < '0' || ch > '9'){
		AK = ch =='-'?-1:1;
		ch = getchar();
	}
	while (ch <= '9' && ch >= '0'){
		IOI = (IOI << 3) + (IOI << 1);
		IOI += ch - 48;
		ch = getchar();
	}
	return AK * IOI;
}

int ksm(int x, int k){
	int y = 1;
	while (k){
		if (k & 1){
			y = y * x;
			y %= Mod;
		}
		x = x * x;
		x = x % Mod;
		k = k / 2;
	}
	return y;
}
int tail;
const int Maxx = 500006;

int to[Maxx * 2];
int pr[Maxx * 2];
int hd[Maxx];
void push_add(int x, int y){
	to[++ tail] = y;
	pr[tail] = hd[x];
	hd[x] = tail;
}
int n, m;
long long ans = 0;
int c[Maxx];
//inline void check(){
//	
//}
//inline void dfs(int x){
//	if (x > n){
//		check();
//		return ;
//	}
//	c[i] = 0;
//	dfs(x + 1);
//	c[i] = 1;
//	dfs(x + 1);
//}
int main(){
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	n = read(), m = read();
	for (int i = 1; i <= m; ++ i){
		int x = read(), y = read();
		push_add(x, y);
		push_add(y, x);
	}
	if (n == m + 1 && n > 3000){
		for (int i = 1; i <= n; ++ i){
			for (int j = i + 1; j <= n; ++ j){
				ans = ans + (ksm(2, j - i - 1) * ksm(2, m - (j - i))) % Mod;
				ans = ans % Mod;
			}
		}
		ans += n * ksm(2, m);
		ans %= Mod;
		printf("%lld\n", ans);
		return 0;
	}
//	dfs(1);
//	for (int K = 1; K <= n; ++ K){
//		int head = 1, tail = 1;
//		dl[head] . x = K;
//		for (int j = 1; j <= n; ++ j){
//			dl[1] . b[j] = 1; 
//		}
//		dl[1] . b[i] = 0;
//		while (head <= tail){
//			int x = dl[head] . x;
//			for (int i = hd[x], v = to[i]; i; i = pr[i], v = to[i]){
//				if (dl[head] . b[v] == 1){
//					dl[++ tail] . x = v;
//					dl[tail] . b = dl[head] . b;
//					dl[tail] . b[v] = 0;
//					dl[tail] . y = dl[head] . y + 1;
//				}
//			}
//			head ++;
//		}
//		for (int i = 2; i <= tail; ++ i){
//			ans += 
//		}
//	}
}