#include<bits/stdc++.h>
using namespace std;

#define ll long long

const ll N = 3e3+5;
const ll M = 5e4+5;
const ll mo = 1e9+7;

ll n,m;
struct edge{ll v,nxt;}e[M<<1];
ll tott,head[N];
void add(ll u,ll v){
	e[++tott]=(edge){v,head[u]};
	head[u]=tott;
}

ll ksm(ll a,ll b){
	ll res=1;
	while(b){if(b&1)res=res*a%mo;a=a*a%mo;b>>=1;}
	return res;
}

ll fa[N];
ll find(ll x){
	if(x==fa[x])return x;
	return fa[x]=find(fa[x]);
}
void uni(int u,int v){
	int fu=find(u);int fv=find(v);
	fa[fu]=fv;
}
int inpa[N],pa[N],tail;

void dfs(int x){
	int fx=find(x);
	for(int i=head[x];i!=-1;i=e[i].nxt){
		int v=e[i].v;int fv=find(v);
		if(fx==fv)continue;
		if(inpa[v]){
			while(find(pa[tail])!=find(v)){
				int xx=pa[tail--];
				uni(x,xx);
			}
			uni(v,x);
		}
		pa[++tail]=v;inpa[v]=1;
		dfs(v);
		tail--;inpa[v]=0;
	}
}

int cntn[N],cntm[N];
vector<int> col[N];
int vis[N],mm;
queue<int> q;

int tot,ful[N];

void dfs2(int u){
	for(int i=head[u];i!=-1;i=e[i].nxt){
		int v=e[i].v;
		if(!vis[v] && find(v)==find(u)){
			vis[v]=1;
			dfs2(v);
//			cout<<v<<endl;
		}
		mm++;
	}
}

int vis3[N];

map<pair<int,int>,int> linkk;
#define pii(x,y) make_pair(x,y)

void dfs3(int u){
	int fu=find(u);
	for(int i=head[u];i!=-1;i=e[i].nxt){
		int v=e[i].v;int fv=find(v);
		if(!linkk[pii(u,v)]==-1)
		{
			add(find(u),find(v));
			add(find(v),find(u));
			linkk[pii(u,v)]=linkk[pii(v,u)]=1;
		}
		if(!vis3[find(v)]){
			vis3[v]=1;
			dfs3(v);
		}
	}
}

ll res;

ll dfs4(int u,int k,int las){
	if(k==0)return (ll)ksm(2,cntn[u])*ksm(2,cntm[u])%mo;
	ll rr=1;
	for(int i=head[u];i!=-1;i=e[i].nxt){
		int v=e[i].v;
		if(v==las)continue;
		rr=rr*dfs4(v,k-1,u)%mo;
	}
	return rr;
}

int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);

	cin>>n>>m;
	for(int i=1;i<=n;++i)head[i]=-1;
	for(ll i=1;i<=m;++i){
		ll u,v;cin>>u>>v;
		add(u,v);add(v,u);
	}
		
	for(ll i=1;i<=n*2;++i)
		fa[i]=i;
		
	dfs(1);
	for(ll i=1;i<=n;++i)fa[i]=find(i);
	
//	cout<<"QQA"<<endl;
	
	tot=n;
	
	for(int i=1;i<=n;++i)
		if(!ful[find(i)])fa[fa[i]]=++tot,ful[tot]=1,fa[tot]=tot;
	
//	cout<<"QQA"<<endl;
	for(int i=1;i<=n;++i)
		col[find(i)].push_back(i);
//	cout<<"QQA"<<endl;
	for(int i=1;i<=n;++i){
		int cc=find(i);
		if(vis[cc])continue;
		vis[cc]=1;mm=0;
		dfs2(cc);
		cntm[cc]=mm;
		cntn[cc]=col[cc].size();
//		cout<<i<<"ed"<<endl;//
	}
//	cout<<"QQA"<<endl;
	dfs3(1);
//	cout<<"QQA"<<endl;
	res=0;
//	cout<<"QQA"<<endl;
	for(int k=0;k<=n;++k){
		for(int i=n+1;i<=tot;++i)
			res = (res + dfs4(i,k,-1))%mo;
	}
	
	cout<<res<<endl;
	
	return 0;
}
