#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int M=2e6+10,N=5e5+10;
const ll mod=1e9+7;
int cnt=1,head[N],tmp,s[N],dfn[N],low[N],col[N],r,num[N],n,m,head1[N],siz,fa[N],tot;bool vis[N];
map<pair<int,int>,bool> mp;
struct E
{
	int to,nxt;
}e[M],e1[M];
void add(int u,int v)
{
	e[++cnt]=(E){v,head[u]};
	head[u]=cnt;
}
void add1(int u,int v)
{
	e1[++cnt]=(E){v,head1[u]};
	head1[u]=cnt;
}
void dfs(int p,int las)
{
	dfn[p]=low[p]=++tmp;s[++r]=p;
	for(int i=head[p];i;i=e[i].nxt)
	{
		if(i==(las^1)) continue;
		if(dfn[e[i].to]) low[p]=min(low[p],dfn[e[i].to]);
		else dfs(e[i].to,i),dfn[p]=min(dfn[p],low[e[i].to]);
	}
	if(dfn[p]==low[p])
		while(s[r+1]!=p)
			num[p]++,col[s[r]]=p,r--;
}
void solve(int p,int st)
{
	siz+=num[p];vis[p]=true;
	for(int i=head1[p];i;i=e1[i].nxt)
	{
		int to=e1[i].to;
		if(vis[e1[i].to]) continue;
		if(to==fa[p]&&(st&(1<<s[p]))||fa[to]==p&&(st&(1<<s[to])))
			solve(to,st);
	}
}
void dfs1(int p,int fath)
{
	fa[p]=fath;
	for(int i=head1[p];i;i=e1[i].nxt)
	{
		int to=e1[i].to;
		if(to==fath) continue;
		dfs1(to,p);
	}
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d %d",&n,&m);
	for(int i=1,u,v;i<=m;i++)
	{
		scanf("%d %d",&u,&v);
		add(u,v),add(v,u);
	}
	dfs(1,0);cnt=1;
	for(int i=1;i<=n;i++)
		for(int j=head[i];j;j=e[j].nxt)
			if(col[i]!=col[e[j].to]&&!mp[make_pair(col[i],col[e[j].to])])
				add1(col[i],col[e[j].to]),mp[make_pair(col[i],col[e[j].to])]=true;
	for(int i=2;i<=n;i++)
		if(i==col[i])
			s[i]=tot++;
	ll ans=0;
	dfs1(1,0);
	for(int i=0;i<(1<<tot);i++)
	{
		for(int j=1;j<=n;j++) vis[j]=false;
		for(int j=1;j<=n;j++)
			if(!vis[j])
			{
				siz=0;
				solve(j,i);
				ans=(ans+(1<<siz)-1)%mod;
			}
	}
	printf("%lld",ans*(1<<(m-tot))%mod);
}
