#include<bits/stdc++.h>
using namespace std;
const int md=1e9+7;
int ans,n,m,u[100],v[100],sz[100],F[100],pw[111];
inline int find(int x){
	return F[x]==x?x:F[x]=find(F[x]);
}
inline void dfs(int x,int y){
	if(x>m){cout<<"::"<<y<<endl;ans=(ans+y)%md;return;}
	dfs(x+1,y);
	int cx=u[x],cy=v[x],ex=find(cx),ey=find(cy);
	if(ex!=ey){
		F[ex]=ey;
		y=(y+0ll+pw[sz[ex]+sz[ey]]-pw[sz[ex]]-pw[sz[ey]])%md;
		sz[ey]+=sz[ex];
		dfs(x+1,y);
		sz[ey]-=sz[ex];
		F[ex]=ex;
	}else dfs(x+1,y);
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=m;++i)
		cin>>u[i]>>v[i];
	pw[0]=1;
	for(int i=1;i<=n;++i)
		pw[i]=pw[i-1]*2%md;
	for(int i=1;i<=n;++i)
		pw[i]--;
	for(int i=1;i<=n;++i)
		F[i]=i,sz[i]=1;
	if(m<=25){
		dfs(1,n);
		cout<<ans<<'\n';
	}
}