#include <cmath>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int Mod = 1e9 + 7;
queue <int> q;
struct Edge {
	int to, next;
}e[5000000];
int n, m, across_able[2100000], be_in_circle[2100000], head[1200000], from[1200000], d[1200000], f[1200000];
bool v[5000000];
int cnt = -1;

inline void insert(int u, int v) {
	e[++cnt] = (Edge) {
		v, head[u]
	};
	head[u] = cnt;
}

void set_circle(int u, int v) {
	while (u != v) {
		if (d[f[u]] < d[f[v]])
			swap(u, v);
		
		be_in_circle[from[u]] = be_in_circle[from[u] ^ 1] = 1;
		u = f[u];
	}
}

void find_circle() {
	memset(v, 0, sizeof(v));
	memset(d, 0, sizeof(d));
	q.push(1);
	d[1] = 1;
	v[1] = 1;
	
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		
		for (int i = head[u]; i != -1; i = e[i].next) {
			int t = e[i].to;
			
			if (t == f[u])
				continue;
			
			if (v[t]) {
				be_in_circle[i] = be_in_circle[i ^ 1] = 1;
				set_circle(u, t);
				continue;
			}
			
			f[t] = u;
			from[t] = i;
			d[t] = d[u] + 1;
			v[t] = 1;
			q.push(t);
		}
	}
}

queue <int> q1;
int bfs(int st) {
	memset(v, 0, sizeof(v));
	q1.push(st);
	v[st] = 1;
	int res = 1;
	
	while (!q1.empty()) {
		int u = q1.front();
		q1.pop();
		
		for (int i = head[u]; i != -1; i = e[i].next)
			if (across_able[i]) {
				int t = e[i].to;
			
				if (v[t])
					continue;
				
				q1.push(t);
				v[t] = 1;
				res++;
		}
	}
	
	return res;
}

int solve(int x) {
	memcpy(across_able, be_in_circle, sizeof(across_able));
	
	for (int i = 0; i < m; i++)
		if (x & (1 << i))
			across_able[i * 2] = across_able[i * 2 + 1] = 1;
	
	memset(v, 0, sizeof(v));
	int res = 0;
	
	for (int i = 1; i <= n; i++)
		if (!v[i]) {
			int num = 1, lim = bfs(i);
			
			for (int j = 1; j <= lim; j++)
				num = (num << 1) % Mod;
			
			res = (res + num - 1) % Mod;
		}
	
	return res;
}

int main() {
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%d %d", &n, &m);
	
	for (int i = 0; i <= 2 * m + 2; i++)
		e[i].next = -1;
	
	for (int i = 0; i <= n + 1; i++)
		head[i] = -1;
	
	for (int i = 1; i <= m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		insert(u, v);
		insert(v, u);
	}
	
	find_circle();
	
	if (m <= 30) {
		int ans = 0;
		
		for (int i = 0, lim = (1 << m) - 1; i <= lim; i++)
			ans = (ans + solve(i)) % Mod;
		
		printf("%d\n", ans);
	}
	else {
		int ans = 1;
		
		for (int i = 1; i <= n + m; i++)
			ans = (ans << 1) % Mod;
		
		printf("%d\n", ans);
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
