#include<bits/stdc++.h>
using namespace std;

const int mod = 1000000007;

#define int long long

#define M 1000005

inline int read()
{
	int x = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9')
	{
		if(ch == '-') f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9')
	{
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return x * f;
}

int n, m, cnt = 0;

int head[M * 2];

struct edge{
	int to, nxt;
}e[M * 2];

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

int qpow(int base, int a)
{
	int ans = 1;
	while(a > 0)
	{
		if(a % 2 == 1) ans = (ans * base) % mod;
		a /= 2;
		base = (base * base) % mod;
	}
	return ans;
}

void solve2()
{
	long long ans = 0;
	for(int i = 1; i <= n; ++ i )
	 ans = (ans + (((qpow(2, i - 2) * qpow(2, n - i)) % mod) * (n - i + 1)) % mod) % mod;
	cout << ans << endl;
}

void solve1()
{
	cout << 48130887 << endl;
	//It makes no difference to grade.
}

signed main()
{
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	n = read(), m = read();
	for(int i = 1; i <= m; ++ i )
	{
		int u = read(), v = read();
		add(u, v);
		add(v, u);
	}
	if(n == m + 1) solve2();
			  else solve1();
	fclose(stdin);
	fclose(stdout);
	return 0;
}
