#include<bits/stdc++.h>
using namespace std;
const int Mod=10000007;
int n,m;
int inpx[500005];
int inpy[500005];
struct Edge{
	int nxt,to;
}e[2000005];
int head[500005];
int p[500005];
int v[500005];
int cnt=0;
int ind=0;
int dfn[500005];
int low[500005];
int stk[500005],top=0;
int fat[500005];
bool vis[500005];
long long f[500005];
int d=0;
inline int getr(int x){
	return x==fat[x]? x:fat[x]=getr(fat[x]);
}
inline void addE(int x,int y){
	e[++cnt]=(Edge){head[x],y};
	head[x]=cnt;
	return;
}
inline long long baseto(int x){
	long long bse=2;
	long long ret=1;
	while(x){
		if(x&1)ret=(ret*bse)%Mod;
		bse=(bse*bse)%Mod;
		x>>=1;
	}
	return ret;
}
inline void tarjan(int x,int fa){
	dfn[x]=++ind,low[x]=ind;
	stk[++top]=x;
	for(int i=head[x];i;i=e[i].nxt){
		int y=e[i].to;
		if(y==fa)continue;
		if(!dfn[y]){
			tarjan(y,x);
			low[x]=min(low[x],low[y]);
		}else{
			low[x]=min(low[x],dfn[y]);
		}
	}
	if(low[x]==dfn[x]){
		while(stk[top]!=x)fat[stk[top]]=x,--top,++p[x];
		--top;
		++p[x];
	}
}
inline void dfs(int x,int fa){
	long long mul=1;
	for(int i=head[x];i;i=e[i].nxt){
		int y=e[i].to;
		if(fat[y]==fa);
		if(vis[fat[y]])continue;
		vis[fat[y]]=1;
		dfs(fat[y],x);
		mul=(mul*(f[fat[y]]+1))%Mod;
	}
	f[x]=(mul*baseto(v[x]+p[x]))%Mod;
}
int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	//put my code here
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)fat[i]=i;
	for(int i=1;i<=m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		inpx[i]=x;
		inpy[i]=y;
		addE(x,y);
		addE(y,x);
	}
	tarjan(1,0);
	for(int i=1;i<=m;i++){
		if(getr(inpx[i])==getr(inpy[i]))++v[getr(inpx[i])],++d;
	}
	vis[1]=1;
	dfs(1,0);
	printf("%lld",(f[1]-baseto(d)+Mod)%Mod);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
