#include<bits/stdc++.h>
using namespace std;

#define MOD 1000000007LL
int dst[2034567];
int DST[2034567];
int NXT[2034567];
int nxt[2034567];
int HEAD[507890];
int head[507890];
bool vis[507890];
int stck[507890];
int color[507890];

long long f[507890][2];
int counte[507890];
int countp[507890];
int DFN[507890];
int LOW[507890];
int cnt,CNT,top,timestamp,cntc;


inline void ADDEDGE(const int x,const int y) {
	DST[++CNT] = y;
	NXT[CNT] = HEAD[x];
	HEAD[x] = CNT;
}
inline void addedge(const int x,const int y) {
	dst[++cnt] = y;
	nxt[cnt] = head[x];
	head[x] = cnt;
}
void tarjan(const int fa,const int x) {
	vis[x] = 1;
	stck[++top] = x;
	DFN[x] = LOW[x] =  ++timestamp;
	for (int i = head[x]; ~i; i = nxt[i])
		if (dst[i]!=fa) {
			if (!vis[dst[i]])
				tarjan(x,dst[i]);
			LOW[x] = min(LOW[x],LOW[dst[i]]);
		}
	if (LOW[x] == DFN[x]) {
		int tmptop = top;
		for (color[x] = ++cntc; stck[top]!=x;color[stck[top--]] = cntc);
			top = tmptop;
		while (stck[top]!=x) {
			for (int i=head[stck[top--]]; ~i; i = nxt[i]) {
				if (color[dst[i]] && color[dst[i]]!=cntc) {
					ADDEDGE(cntc,color[dst[i]]);
					ADDEDGE(color[dst[i]],cntc);
				} else if (color[dst[i]]==cntc)
					counte[cntc]++;
			}
		}
		for (int i=head[x]; ~i; i = nxt[i])  {
			if (color[dst[i]] && color[dst[i]]!=cntc) {
				ADDEDGE(cntc,color[dst[i]]);
				ADDEDGE(color[dst[i]],cntc);
			} else if (color[dst[i]]==cntc)
				counte[cntc]++;
		}
		--top;
		countp[cntc] = tmptop-top;
		counte[cntc]>>=1;
	}
}
inline long long QuickPow(long long Base,int Index,long long Result = 1) {
	for (;Index;Base = (Base * Base)%MOD,Index >>= 1)
		if (Index&1)
			Result = (Result * Base)%MOD;
	return Result;		
}
void Dfs(const int fa,const int x) {
	for (int i=HEAD[x]; ~i; i = NXT[i])
		if (DST[i] != fa)
			Dfs(x,DST[i]);
	f[x][0] = QuickPow(2,counte[x]);
	f[x][1] = 0;
	for (int i=HEAD[x]; ~i; i = NXT[i])
		if (DST[i] != fa)
			f[x][0] = (f[x][0]*((f[DST[i]][0]*2LL)%MOD))%MOD;
	for (int i=HEAD[x]; ~i; i = NXT[i])
		if (DST[i] != fa)
			f[x][1] = (f[x][1]+(f[DST[i]][1]*3%MOD+f[DST[i]][0]*2%MOD)%MOD)%MOD;
	if (f[x][1] == 0) f[x][1] = 1;
	f[x][1] = f[x][1]*((QuickPow(2,countp[x])-1)*QuickPow(2,counte[x])%MOD)%MOD;
}
int main() {
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	memset(head,-1,sizeof head);
	memset(HEAD,-1,sizeof HEAD);
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for (int i=1; i<=m; ++i)
		scanf("%d%d",&x,&y),
		addedge(x,y),
		addedge(y,x);
	tarjan(0,1);
	Dfs(0,1);
	printf("%lld\n",f[1][1]);
	return 0;
}
