#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <unordered_map>

typedef long long LL;

using namespace std;

const int N = 5e5, M = 2e6, mod = 1e9 + 7;

int n, m;
int e[M],ne[M],idx,h[N];
LL f[M];
int fact[N], infact[N];

void add(int a, int b){
	e[idx] = b, ne[idx] = h[a], h[a] = idx ++;
}

LL qmi(LL a, LL b){
	LL res = 1;
	a %= mod;
	while(b){
		if(b&1) res = res*a%mod;
		b >>= 1;
		a = a*a%mod;
	}
	
	return res;
}

int main(){
	
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	
	memset(h, -1, sizeof h);
	
	scanf("%d%d", &n, &m);
	
	fact[0] = infact[0] = 1;
	for(int i = 1; i < N; i ++){
		fact[i] = (LL)fact[i-1]*i%mod;
		infact[i] = (LL)infact[i-1]*qmi(i, mod-2)%mod;
	}
	
	for(int i = 1; i <= m; i ++){
		int a, b;
		cin>>a>>b;
		add(a,b), add(b,a);
	}
	
	if(m == 1){
		printf("5\n");
	}
	else{
		f[1] = 5;
		LL res = f[1];
		for(int i = 2; i <= n; i ++){
			res = (res + f[i-1])%mod;
			f[i] = res;
		}
		res = res+qmi(2, n-1)%mod;
		printf("%d", res);
	}
	
	
	
	return 0;
}

/*
4 3
1 2
2 3
3 4

*/