#include<cstdio>
#include<iostream>
using namespace std;

#define ll long long
#define N 500005
#define M 1000005
const ll mod=1e9+7;
int n,m;
int dfsn[N],low[N],tim;
int col[N],num;
int dad[N];
ll siz[N],len[N],ans;
ll ssiz[N],slen[N];
int head[N],to[M<<1],nxt[M<<1],cnt=1;
int Head[N],To[M<<1],Nxt[M<<1],Cnt;
bool vis[M<<1];
bool iss[M<<1];
void add(int u,int v)
{
	to[++cnt]=v;
	nxt[cnt]=head[u];
	head[u]=cnt;
}
void Add(int u,int v)
{
	To[++Cnt]=v;
	Nxt[Cnt]=Head[u];
	Head[u]=Cnt;
}
ll qp(ll a,ll b){
	if (b<0) return 0;
	ll res=1;
	for ( ; b ; b>>=1,a=a*a%mod) if (b&1) res=res*a%mod;
	return res;
}
void work1()
{
	ans=0;
	for (int i=0 ; i<=n-1 ; i++)
	    ans=(ans+qp(2,max(0,i-2)) * qp(2,n-i-1)%mod * 1ll*(n-i)%mod)%mod;
	printf("%lld\n",ans);
}
void tarjan(int u,int num)
{
	dfsn[u]=low[u]=++tim;
	for (int i=head[u] ; i; i=nxt[i]){
		int v=to[i];
		if ((i^1)==num) continue;
		if (!dfsn[v]){
			tarjan(v,i);
			low[u]=min(low[u],low[v]);
		}else low[u]=min(low[u],dfsn[v]);
		if (low[v]>low[u]) vis[i]=vis[i^1]=1;
	}
}
void dfs(int u,int tot)
{
	for (int i=head[u] ; i ; i=nxt[i]){
		int v=to[i];
		if (vis[i]) continue;
		len[num]++;
		if ((i^1)==tot) continue;
		if (!col[v]){
			col[v]=num;
			siz[num]++;
			dfs(v,i);
		}
	}
}
void find(int u,int fa)
{
	dad[u]=fa;
	ssiz[u]=siz[u];
	slen[u]=len[u];
	for (int i=Head[u] ; i ; i=Nxt[i]){
		int v=To[i];
		if (v==fa) continue;
		find(v,u);
		ssiz[u]+=ssiz[v];
		slen[u]+=slen[v];
	}
	ans=(ans-(qp(2,ssiz[u])-1+mod)%mod * qp(2,slen[u])%mod *(qp(2,n-ssiz[u])-1+mod)%mod * qp(2,m-slen[u])%mod +mod)%mod;
}
void work2()
{
	tarjan(1,0);
	for (int i=1 ; i<=n ; i++)
	    if (!col[i]){
	    	++num;
	    	col[i]=num;
	    	siz[num]=1;
	    	dfs(i,0);
	    	len[num]/=2;
		}
	ll SS=0;
	for (int u=1 ; u<=n ; u++)
	    for (int i=head[u] ; i ; i=nxt[i])
	        if (col[u]!=col[to[i]]){
	        	SS++;
	        	Add(col[u],col[to[i]]);
	        }
	ans=(qp(2,n)-1+mod)%mod*qp(2,m)%mod;
	m-=SS/2;
	find(1,0);
	printf("%lld\n",ans);
	return ;
}
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	scanf("%d%d",&n,&m);
    for (int i=1 ; i<=m ; i++){
    	int u,v;
    	scanf("%d%d",&u,&v);
    	add(u,v),add(v,u);
	}
	if (m==n-1) work1();
	else work2();
	return 0;
}