#include <iostream>
#include <cstdio>
#define ll long long
using namespace std;
const ll p = 1e9+7;
ll n, m, ans = 0, pow2[5100];
ll nxt[10100], to[10100], top[3100], cnte = 0;
ll del[10100], vis[3100];
void add_edge(int u, int v){
	cnte++;
	nxt[cnte] = top[u];
	to[cnte] = v;
	top[u] = cnte;
}

ll dfs(int u){
	ll cnt = 1;
	vis[u] = 1;
	for(int i = top[u]; i; i = nxt[i]){
		int v = to[i];
		if(del[i] == 1 || vis[v]) continue;
		cnt += dfs(v);
	}
	return cnt;
}

int main(){
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%lld%lld", &n, &m);
	for(int i = 1; i <= m; i++){
		ll u, v;
		scanf("%lld%lld", &u, &v);
		add_edge(u, v);
		add_edge(v, u);
	}
	pow2[0] = 1;
	for(int i = 1; i <= max(n, m); i++)
		pow2[i] = pow2[i-1] * 2 % p;
	for(ll i = 1; i <= m; i++){
		del[2*i-1] = del[2*i] = 1;
		for(int j = 1; j <= n; j++) vis[j] = 0;
		for(int j = 1; j <= n; j++){
			if(!vis[j]){
				ll res = dfs(j);
//				printf("! %lld %lld\n", i, res);
				ans = (ans + pow2[res] - 1) % p;
			}
		}
		del[2*i-1] = del[2*i] = 0;
	}
	printf("%lld\n", ans);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
