#include<bits/stdc++.h>
#define rint register int
#define fu(i,a,b,d,c) for(rint i=a;i<=b&&c;i+=d)
#define fd(i,a,b,d,c) for(rint i=a;i>=b&&c;i-=d)
using namespace std;
inline int read(){
	char c=0,f=1;int num=0;
	while(c<'0'||c>'9')((c=getchar())=='-')&&(f=-f);
	while(c>='0'&&c<='9')num=(num<<1)+(num<<3)+(c^48),c=getchar();
	return num*f;
}
const int MAXN = 500050, MAXM = 1000050, LJC = 1e9+7;
int cnt0,head0[MAXN],to0[MAXM<<1],nxt0[MAXM<<1];
void add0(int u,int v){
	nxt0[++cnt0]=head0[u],head0[u]=cnt0,to0[cnt0]=v;
}
int cnt1,head1[MAXN],to1[MAXM<<1],nxt1[MAXM<<1];
void add1(int u,int v){
	nxt1[++cnt1]=head1[u],head1[u]=cnt1,to1[cnt1]=v;
}
int cnt,dfn[MAXN],low[MAXN],dcnt,edcc[MAXN];
int psz[MAXN],esz[MAXN];
int stk[MAXN],top;

int n,m;
int pow2[MAXN],f[MAXN][2],esum[MAXN];

void tarjan(int p,int fa){
	low[p]=dfn[p]=++cnt;
	stk[++top]=p;
	for(int i=head0[p],sn;i;i=nxt0[i]){
		sn=to0[i];
		if(!dfn[sn]){
			tarjan(sn,p);
			low[p]=min(low[p],low[sn]);
		}else if(sn!=fa){
			low[p]=min(low[p],dfn[sn]);
		}
	}
	if(low[p]==dfn[p]){
		dcnt++;
		while(top&&stk[top]!=p)edcc[stk[top]]=dcnt,top--;
		edcc[p]=dcnt,top--;
	}
}
void dfs(int p,int fa){
	f[p][1]=1ll*(pow2[psz[p]]-1)*pow2[esz[p]]%LJC;
	esum[p]=esz[p];
	for(int i=head1[p],sn;i;i=nxt1[i])if((sn=to1[i])!=fa){
		dfs(sn,p);
		f[p][1]=(1ll*(f[p][1]+pow2[esz[p]])*pow2[esum[sn]]%LJC+1ll*(f[p][1]+pow2[esz[p]])*(f[sn][1])%LJC)%LJC;
		esum[p]+=esum[sn]+1;
	}
	f[p][0]=0;
	for(int i=head1[p],sn;i;i=nxt1[i])if((sn=to1[i])!=fa){
		(f[p][0]+=1ll*f[sn][1]*pow2[esum[p]-esum[sn]-1]%LJC)%=LJC;
	}
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	pow2[0]=1;
	fu(i,1,1000000,1,1)pow2[i]=2ll*pow2[i-1]%LJC;
	n=read(),m=read();
	fu(i,1,m,1,1){
		int u=read(),v=read();add0(u,v),add0(v,u);
	}
	tarjan(1,0);
//	fu(i,1,n,1,1)printf("%d:%d %d in %d\n",i,dfn[i],low[i],edcc[i]);
	fu(i,1,n,1,1){
		psz[edcc[i]]++;
		for(int j=head0[i];j;j=nxt0[j]){
			int sn=to0[j];
			if(edcc[i]==edcc[sn]){
				if(sn>i)esz[edcc[i]]++;
			}
			else if(sn>i)add1(edcc[i],edcc[sn]),add1(edcc[sn],edcc[i]);
		}
	}
	dfs(1,0);
	printf("%d\n",(f[1][1]+f[1][0])%LJC);
//	fu(i,1,n,1,1)printf("%d in %d: %d %d\n",i,edcc[i],f[edcc[i]][1],f[edcc[i]][0]);
}