#include<bits/stdc++.h>
#define int long long
using namespace std;
int n, m, pa[500010], val[500010], val1[500010], f[500010], mod = 1000000007, power[2000010];
int dfn[500010], low[500010], cnt = 0, sd[500010], col = 0;
vector<int>l[500010];
vector<int>g[500010];
stack<int>s;
bool instack[500010];
int read()
{
	int x = 0, f = 1;
	char c = getchar();
	while(c != EOF and !isdigit(c))
	{
		if(c == '-')f = -1;
		c = getchar();
	}
	while(isdigit(c))
	{
		x = x * 10 + c - '0';
		c = getchar();
	}
	return x * f;
}
void dfs(int u, int fa)
{
	if(g[u].size() == 0)
	{
		f[u] = 1;
		return ;
	}
	int res = 1;
	for(int i = 0;i < g[u].size();i ++)
	{
		int v = g[u][i];
		if(v == fa)continue;
		dfs(v, u);
		res = res * (f[v] + 2) % mod;
	}
	res = res * power[val[u] + val1[u]] % mod;
	f[u] = (res - power[val[u]] + mod) % mod;
}
void tarjan(int u, int fa)
{
	dfn[u] = low[u] = ++ cnt;
	s.push(u);
	instack[u] = true;
	for(int i = 0;i < l[u].size();i ++)
	{
		int v = l[u][i];
		if(v == fa)continue;
		if(! dfn[v])
		{
			tarjan(v, u);
			low[u] = min(low[u], low[v]);
		}
		else if(instack[v])low[u] = min(low[u], dfn[v]);
	}
	if(dfn[u] == low[u])
	{
		int qaq;
		col ++;
		while(! s.empty())
		{
			qaq = s.top();
			s.pop();
			sd[qaq] = col;
			val1[col] ++;
			instack[qaq] = false;
			if(qaq == u)break; 
		}
	}
}
int find(int x)
{
	if(pa[x] == x)return x;
	return pa[x] = find(pa[x]);
}
signed main()
{
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	n = read();
	m = read();
	power[0] = 1;
	for(int i = 1;i <= n + m;i ++)power[i] = power[i - 1] * 2 % mod;
	for(int i = 1;i <= m;i ++)
	{
		int u = read(), v = read();
		l[u].push_back(v);
		l[v].push_back(u);
	}
	memset(instack, false, sizeof(instack));
	memset(dfn, 0, sizeof(dfn));
	memset(low, 0, sizeof(low));
	tarjan(1, 0);
	if(col == 1)
	{
		cout<<(power[n + m] - power[m] + mod) % mod;
		return 0;
	}
	for(int i = 1;i <= col;i ++)pa[i] = i;
	for(int i = 1;i <= n;i ++)
	{
		for(int j = 0;j < l[i].size();j ++)
		{
			int v = l[i][j];
			if(sd[v] == sd[i])val[sd[i]] ++;
			else
			{
				if(find(sd[i]) == find(sd[v]))continue;
				g[sd[i]].push_back(sd[v]);
				g[sd[v]].push_back(sd[i]);
				pa[find(sd[i])] = find(sd[v]);
				//cout<<sd[i]<<' '<<sd[v]<<endl;
			}
		}
	}
	for(int i = 1;i <= col;i ++)val[i] /= 2;
	dfs(sd[1], 0);
	cout<<f[sd[1]];
	return 0;
}

