#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const int MOD=1e9+7;
const int N=500050,M=1000010;
class EDGE_N{
	// Private section
	int num_edge;
	int head[N];
	int nx[M<<1],t[M<<1];
	public:
		// Public Declarations
		EDGE_N(){num_edge=0;}
		void reset(int n){for(int i=1;i<=n;i++)head[i]=-1;num_edge=0;}
		void add(int from,int to){
			nx[++num_edge]=head[from];
			t[num_edge]=to;
			head[from]=num_edge;
		}
		int H(int i){return head[i];}
		int N(int i){return nx[i];}
		int T(int i){return t[i];}
	protected:
		// Protected Declarations
}e1,e2;
int n,m;
int u[M],v[M];
int dfn[N]={},LOW[N]={},BLT[N]={},bltn=0,xdf=0;
int TK[N]={},tkh=0;
int nd[N]={};
void TJ(int i,int fa){
	dfn[i]=++xdf;
	LOW[i]=dfn[i];
	TK[++tkh]=i;
	for(int e=e1.H(i);e!=-1;e=e1.N(e)){
		if(dfn[e1.T(e)]==0){
			TJ(e1.T(e),i);
		}
		if(LOW[e1.T(e)]<LOW[i]&&e1.T(e)!=fa)LOW[i]=LOW[e1.T(e)];
	}
	if(LOW[i]==dfn[i]){
		bltn++;
		while(TK[tkh]!=i)BLT[TK[tkh]]=bltn,tkh--,nd[bltn]++;
		BLT[i]=bltn,tkh--,nd[bltn]++;
	}
}
ull pr2[N+M];
ull ans;
int su[N];
int bltm=0,nu[M],nv[M];
void dfs1(int i,int fa){
	su[i]=nd[i];
	for(int e=e2.H(i);e!=-1;e=e2.N(e)){
		if(e2.T(e)!=fa){
			dfs1(e2.T(e),i);
			su[i]+=su[e2.T(e)];
		}
	}
}
void dfs2(int i,int fa){
	for(int e=e2.H(i);e!=-1;e=e2.N(e)){
		if(e2.T(e)!=fa){
			dfs2(e2.T(e),i);
		}
	}
}
namespace s1{
	int fa[N],fnum[N];
	int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
	int mx=0;
	void solve(){
		for(int mask=0;mask<(1<<bltm);mask++){
			for(int i=1;i<=bltn;i++)fa[i]=i,fnum[i]=0;
			for(int j=0;j<bltm;j++){
				if((mask&(1<<j)!=0)&&find(nu[j+1])!=find(nv[j+1])){
					fa[find(nu[j+1])]=find(nv[j+1]);
				}
			}
			for(int i=1;i<=bltn;i++)fnum[find(i)]+=nd[i];
			for(int i=1;i<=bltn;i++){
				ans+=pr2[fnum[i]]-1;
//				printf("%d %d\n",fnum[i],fa[i]);
			}
			ans%=MOD;
		}
		printf("%llu",ans*pr2[m-bltm]%MOD);
	}
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
	pr2[0]=1;
	for(int i=1;i<=n+m;i++)pr2[i]=pr2[i-1]*2%MOD;
	e1.reset(n);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&u[i],&v[i]);
		e1.add(u[i],v[i]);
		e1.add(v[i],u[i]);
	}
	TJ(1,-1);
//	for(int i=1;i<=n;i++)printf("%d %d %d\n",dfn[i],LOW[i],BLT[i]);
	e2.reset(bltn);
	for(int i=1;i<=m;i++){
		if(BLT[u[i]]!=BLT[v[i]]){
			e2.add(BLT[u[i]],BLT[v[i]]);
			e2.add(BLT[v[i]],BLT[u[i]]);
			bltm++;
			nu[bltm]=BLT[u[i]];
			nv[bltm]=BLT[v[i]];
		}
	}
	if(bltn==1){
		printf("%llu",(pr2[n]-1)*pr2[m]%MOD);
		return 0;
	}
	if(m<=25){
		s1::solve();
		return 0;
	}
	ans=pr2[n]*pr2[m]%MOD;
	dfs1(1,-1);
	return 0;
}
