#include<bits/stdc++.h>
using namespace std;
#define file(s) freopen(#s".in","r",stdin),freopen(#s".out","w",stdout)
#define ll long long
#define il inline
#define cst const
#define ret return
#define gc getchar
#define pc putchar
#define HgS 1000000007
il ll rd()
{
	ll res=0;int lab=1;char ch=gc();
	while(ch<'0'||ch>'9')lab^=(ch=='-'),ch=gc();
	while((ch>='0')&&(ch<='9'))res=res*10+(ch&15),ch=gc();
	ret lab?res:-res;
}
il void prt(ll x,char tail='\n')
{
	static char s[45];int t=0;
	if(x<0)x=-x,pc('-');
	do{s[++t]=x%10,x/=10;}while(x);
	while(t)pc(s[t--]|48);
	if(tail)pc(tail);
}
bool tmptmp1;
int n,m,pw[1500005],iw[1500005],h[500005],en,cnt,fa[500005],f[500005],g[500005],ne[500005],nn[500005],ans;
struct edge{int nxt,to;}e[1000005];
il void adde(int u,int v){e[++en].nxt=h[u],e[en].to=v;h[u]=en;}
il void addl(int u,int v){adde(u,v);adde(v,u);}
namespace build
{
	int u[1000005],v[1000005],f[500005],fa[500005],bl[500005],dis[500005],h[500005],en;bool vis[500005];
	struct edge{int nxt,to;}e[2000005];
	il void adde(int u,int v){e[++en].nxt=h[u],e[en].to=v;h[u]=en;}
	il void addl(int u,int v){adde(u,v);adde(v,u);}
	il int get(int x){while(x^fa[x])x=fa[x]=fa[fa[x]];ret x;}
	il bool merge(int u,int v){ret ((u=get(u))^(v=get(v)))&&(fa[u]=v,1);}
	void dfs(int x,int f)
	{
		build::f[x]=f;vis[x]=1;
		for(int i=h[x],y;i;i=e[i].nxt)if(!vis[y=e[i].to])dis[y]=dis[x]+1,dfs(y,x);
	}
	void work()
	{
		for(int i=1;i<=n;++i)fa[i]=i;
		for(int i=1;i<=m;++i)u[i]=rd(),v[i]=rd(),addl(u[i],v[i]);
		dfs(1,0);
		for(int i=1;i<=m;++i)
		{
			int x=u[i],y=v[i];
			if(dis[x]<dis[y])swap(x,y);
			if(f[x]==y)continue;
			//cerr<<"Find:"<<x<<' '<<y<<endl;
			while(dis[x]>dis[y])merge(x,f[x]),x=get(f[x]);
			while(dis[x]<dis[y])merge(y,f[y]),y=get(f[y]);
			while(x^y)merge(x,f[x]),merge(y,f[y]),x=get(f[x]),y=get(f[y]);
		}
		for(int i=1;i<=n;++i){if(!bl[get(i)]){bl[get(i)]=++cnt;}++nn[bl[i]=bl[get(i)]];}
		for(int i=1;i<=m;++i)
		{
			if(bl[u[i]]==bl[v[i]])++ne[bl[u[i]]];
			else ::addl(bl[u[i]],bl[v[i]]);
		}
		//for(int i=1;i<=n;++i)cerr<<f[i]<<" \n"[i==n];
		//for(int i=1;i<=n;++i)cerr<<bl[i]<<" \n"[i==n];
		//for(int i=1;i<=n;++i)cerr<<dis[i]<<" \n"[i==n];
		//for(int i=1;i<=cnt;++i)cerr<<nn[i]<<" \n"[i==cnt];
		//for(int i=1;i<=cnt;++i)cerr<<ne[i]<<" \n"[i==cnt];
		//for(int i=1;i<=::en;i+=2)cerr<<::e[i+1].to<<' '<<::e[i].to<<endl;
	}
}
void dfs(int x,int fr)
{
	fa[x]=fr;f[x]=pw[nn[x]]-1;g[x]=pw[nn[x]]-1;
	for(int i=h[x],y;i;i=e[i].nxt)if((y=e[i].to)^fr)dfs(y,x),f[x]=1ll*f[x]*(1ll*iw[1]*f[y]%HgS+1)%HgS,g[x]=(g[x]+1ll*iw[1]*f[y]%HgS*(pw[nn[x]]-1))%HgS;
}
bool tmptmp2;
int main()
{
	//file(barrack);
	//cerr<<(&tmptmp1-&tmptmp2)/1048576.L<<endl;
	n=rd();m=rd();build::work();pw[0]=iw[0]=1;for(int i=1;i<=n+m;++i)pw[i]=2*pw[i-1]%HgS,iw[i]=1ll*((HgS+1)>>1)*iw[i-1]%HgS;
	dfs(1,0);prt(1ll*ans*pw[m]%HgS);
	for(int i=1;i<=cnt;++i)cerr<<f[i]<<endl;
	ret 0;
}