#include<bits/stdc++.h>
#define maxn 1000005
#define int long long 
#define ull unsigned long long
#define put() putchar('\n')
using namespace std;
inline void read(int &x) {
	x=0;char ch=getchar();int f=1;
	while (ch<'0'||ch>'9') {if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	x*=f;
}
int dfn[maxn],low[maxn],stac[maxn],tot,times,n,m;
int head=1,h[maxn],ecc[maxn],siz[maxn],mm[maxn],eccnum;
struct yyy{
	int to,z,flag;
	inline void add(int x,int y) {
		to=y;z=h[x];h[x]=head;
	}
}a[maxn*2];
vector<int>O[maxn];
inline void tarjan(int x,int pre) {
	dfn[x]=low[x]=++times;stac[++tot]=x;int i;
	for (i=h[x];i;i=a[i].z) if ((i^1)!=pre) {
		if (!dfn[a[i].to]) {
			tarjan(a[i].to,i);
			low[x]=min(low[x],low[a[i].to]);
		}
		else low[x]=min(low[x],dfn[a[i].to]);
	}
	if (low[x]==dfn[x]) {
		++eccnum;
		while (stac[tot+1]!=x) {
			ecc[stac[tot]]=eccnum;siz[eccnum]++;
			tot--;
		}
	}
}
const int mod=1e9+7,Inv2=(mod+1)/2;
int pw[maxn*2],ans,f[maxn];
inline void solve(int x,int pre) {
	for (auto y:O[x]) if (y^pre) {
		solve(y,x);
		ans=(ans+f[y]*Inv2%mod*pw[m]%mod*(pw[siz[x]]-1)%mod)%mod;
		f[x]=(f[x]+f[y]*Inv2%mod*pw[siz[x]]%mod)%mod;
	}
	ans=(ans+(pw[siz[x]]-1)*pw[m]%mod)%mod;//bu xuan bian
	f[x]=(f[x]+pw[siz[x]]-1)%mod;
//	printf("%lld : %lld\n",x,f[x]);
}
signed main(void) {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	int i,j,x,y;
	read(n);read(m);
	for (pw[0]=1,i=1;i<=max(n*2,m);i++) pw[i]=pw[i-1]*2%mod; 
	for (i=1;i<=m;i++) {
		read(x);read(y);
		a[++head].add(x,y);
		a[++head].add(y,x);
	}
 	for (i=1;i<=n;i++) if (!dfn[i]) tarjan(i,0);
 	for (j=1;j<=n;j++) {
 		for (i=h[j];i;i=a[i].z) 
 			if (ecc[a[i].to]!=ecc[j]) O[ecc[j]].push_back(ecc[a[i].to]);
 			else mm[ecc[j]]++;
	}
	for (i=1;i<=eccnum;i++) assert(mm[i]%2==0),mm[i]/=2; 
	solve(1,0);
	printf("%lld",ans);
	return 0;
}