#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#define up(i, a, b) for (int i = a; i <= b; i++)
#define dn(i, a, b) for (int i = a; i >= b; i--)
using namespace std;
typedef long long ll;
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 << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return x * f;
}
const int N = 5e5 + 5, mod = 1e9 + 7;
int n, m, idx, head[N];
struct Edg{int u, v;}p[N];
struct Baoli{
	int vec1[N], cnt1, vec2[N], cnt2, fa[N];
	bool vis[N];
	int find(int x) {
//		printf("%d %d\n", x, fa[x]);
		return (x == fa[x]) ? x : find(fa[x]);
	}
	void solve() {
		int ans = 0;
		int mx1 = (1 << n) - 1;
		up(s1, 1, mx1) {
			cnt1 = cnt2 = 0;
			up(i, 1, n) {
				if ((s1 >> (i - 1)) & 1) vec1[++cnt1] = i, vis[i] = 1;
				else vis[i] = 0;
			}
//			printf("cnt1 = %d ST--", cnt1);
//			up(i, 1, cnt1) printf("%d ", vec1[i]); puts("");
			up(i, 1, m) {
				int u = p[i].u, v = p[i].v;
//				printf("u, v, vis1, vis2 = %d %d %d %d\n", u, v, vis[u], vis[v]);
				if (vis[u] || vis[v]) vec2[++cnt2] = i;
			}
			int mx2 = (1 << cnt2) - 1;
//			printf("cnt2 = %d ST--", cnt2);
//			up(i, 1, cnt2) printf("%d ", vec2[i]); puts("");
//			bool f1 = (cnt1 == 3 && vec1[1] == 1 && vec1[2] == 2 && vec1[3] == 3);
//			printf("mx2 = %d\n", mx2);
			up(s2, 0, mx2) {
//				printf("s2 = %d\n", s2);
				up(i, 1, cnt1) fa[vec1[i]] = vec1[i];
				up(i, 1, cnt2) {
					if ((s2 >> (i - 1)) & 1) {
//						if (f1) printf("s2 -> %d ", vec2[i]);
						int now = vec2[i];
						int u = p[now].u, v = p[now].v;
						u = find(u), v = find(v);
//						printf("			%d %d\n", u, v);
						if (u != v) fa[u] = v;
					}
				}
//				if (f1) puts("");
//				if (f1) {
//					puts("----------"); up(i, 1, cnt1) printf("%d ", find(fa[vec1[i]])); puts("");
//				}
				int kuai = 0;
				bool flg = 1;
				up(i, 1, cnt1) {
//					puts("asfdsfaasfd");
//					printf("%d %d\n", vec1[i], fa[vec1[i]]);
					int ft = find(vec1[i]);
//					puts("114514");
					if (!kuai) kuai = ft;
					else if (kuai != ft) {
						flg = 0;
						break;
					}
				}
				if (!flg) continue;
				int res = (1 << (m - cnt2));
//				printf("res = %d\n", res);
				ans += res;
				ans %= mod;
			}
		}
		printf("%d\n", ans);
	}
}P1;
//struct B2{
//	vector <int> vec1;
//	void solve() {
//		int mx = (1 << n) - 1;
//		up(s, 1, mx) {
//			up(i, 1, n) if ((s >> (i - 1)) & 1) vec1.push_back(i);
//			for (int i: vec1) 1;
//		}
//	}
//};
int main() {
//	freopen("barrack1.in", "r", stdin);
//	freopen("barrack2.in", "r", stdin);
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	n = read(), m = read();
	up(i, 1, m) {
		int u = read(), v = read();
		p[i] = {u, v};
	}
	P1.solve();
	return 0;
}













