#include <bits/stdc++.h>
#define LL long long
using namespace std;
int const N=3010,M=5010,mod=1e9+7;
int a[N][N],u[M],v[M],vis[N];
LL c[M],ans;
int n,m,s,x,y;
void dfs(int x){
	s++;
	for(int i=1;i<=n;i++)
	{
		if(a[x][i]==1&&vis[i]==0){
			vis[i]=1;
			dfs(i);
		}
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>n>>m;
	c[1]=1;
	for(int i=2;i<=max(n,m);i++)
	{
		c[i]=(c[i-1]*2+1)%mod;
	}
	ans=c[n]*(c[m]+1)%mod;
	for(int i=1;i<=m;i++)
	{
		cin>>u[i]>>v[i];
		a[u[i]][v[i]]=1;
		a[v[i]][u[i]]=1;
	}
	for(int i=1;i<=m;i++)
	{
		a[u[i]][v[i]]=0;
		a[v[i]][u[i]]=0;
		x=y=0;
		s=0;
		memset(vis,0,sizeof(vis));
		vis[1]=1;
		dfs(1);
		if(s==n) continue; 
		ans=(ans-c[s]*c[n-s]%mod*(c[m-1]+1)%mod+mod)%mod;
		a[u[i]][v[i]]=1;
		a[v[i]][u[i]]=1;
	}
	cout<<ans;
	return 0;
}
