#include <bits/stdc++.h>
#define file(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout)
typedef long long ll;

const int N = 5e5 + 5;
const int M = 6e5 + 5;
const int mod = 1e9 + 7;

struct Edge {
	int from, to, next;
	Edge() {}
	Edge(int from, int to, int next): from(from), to(to), next(next){}
} edge[M * 2];
int num_edge, head[N];

void add_edge(int u, int v) {
	edge[++num_edge] = Edge(u, v, head[u]);
	head[u] = num_edge;
}

int n, m;

bool jy[N], pa[M], no[M];

int c;

bool vis[N];
void dfs(int u) {
	vis[u] = 1;
	if (jy[u])
		c ++;
	for (int p = head[u]; p; p = edge[p].next) {
		int v = edge[p].to;
		if (vis[v] or no[(p + 1) / 2])
			continue;
		dfs(v);
	}
}

int main() {
	file("barrack");
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i ++) {
		int u, v;
		scanf("%d%d", &u, &v);
		add_edge(u, v), add_edge(v, u);
	}
	ll ans = 0;
	for (int i = 1; i <= (1 << n) - 1; i ++)
		for (int j = 0; j <= (1 << m) - 1; j ++) {	
			int f = 1;
			int t = 0;
			for (int k = 1; k <= n; k ++)
				jy[k] = (i >> (k - 1)) & 1, t += jy[k];
			for (int k = 1; k <= m; k ++)
				pa[k] = (j >> (k - 1)) & 1;
			for (int k = 1; k <= m; k ++) if (!pa[k]) {
				no[k] = 1;
				c = 0;
				for (int l = 1; l <= n; l ++)
					vis[l] = 0;
				for (int l = 1; l <= n; l ++) if (jy[l]) {
					dfs(l);
					break;
				}
				no[k] = 0;
				if (c != t) {
					f = 0;
					break;
				}
			}
			ans = (ans + f) % mod;
		}
	printf("%lld", ans);
	return 0;
}
 	