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

int read(){
	int x=0,f=1; char ch=getchar();
	while (!isdigit(ch)){ if (ch=='-') f=-1; ch=getchar(); }
	while (isdigit(ch)){ x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
bool ST;
const int N=1000005;
const int Mod=1000000007;

struct Edge{
	int vet,nxt,from;
}e[N<<2];

struct EDGE{
	int x,y;
}E[N];

int n,m,head[N],edge=1;
int dfn[N],low[N],pow2[N],timer=0;
bool cut[N<<2];

void addedge(int x,int y){
	e[++edge].vet=y; e[edge].from=x;
	e[edge].nxt=head[x];
	head[x]=edge;
}

void Tarjan(int x,int fa){
	dfn[x]=++timer; low[x]=dfn[x];
	for (int i=head[x];i;i=e[i].nxt){
		int v=e[i].vet;
		if (v==fa) continue;
		if (dfn[v]) low[x]=min(low[x],dfn[v]);
		else {
			Tarjan(v,x);
			low[x]=min(low[x],low[v]);
			if (dfn[x]<low[v]) cut[i]=cut[i^1]=true;
		}
	}
}

namespace Subtask1{

int f[N][2];

void Main(){
	f[1][0]=f[1][1]=1;
	for (int i=2;i<=n;++i){
		f[i][0]=f[i-1][0]*2%Mod;
		f[i][1]=(f[i-1][0]*2%Mod+f[i-1][1]*((1<<(i-1))-1)%Mod)%Mod;
	}
	printf("%lld\n",(f[n][0]+f[n][1])%Mod);
}

}

namespace Subtask2{

int chose[N],fa[N];

int getfa(int x){
	if (fa[x]==x) return x;
	else fa[x]=getfa(fa[x]);
	return fa[x];
}

void Main(){
	int ALL=(1<<n)-1,ans=0;
	for (int S=1;S<=ALL;++S){
		for (int i=1;i<=n;++i)
			if ((S>>(i-1))&1) chose[i]=true;
			else chose[i]=false;
		int cnt=0;
		for (int del=1;del<=m;++del){
//			if (!cut[del<<1]) continue;
			for (int i=1;i<=n;++i) fa[i]=i;
			for (int i=1;i<=m;++i){
				if (i==del) continue;
				int fx=getfa(E[i].x),fy=getfa(E[i].y);
				if (fx==fy) continue;
				fa[fx]=fy;
			}
			int rec=0; bool flag=false;
			for (int i=1;i<=n;++i)
				if (chose[i]){
					if (rec==0) rec=getfa(i);
					else if (rec!=getfa(i)){ flag=true; break; }
				}
			if (flag) ++cnt;
		}
		ans=(ans+pow2[m-cnt])%Mod;
	}
	printf("%lld\n",ans%Mod);
}

}

bool ED;

signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	n=read(),m=read();
	pow2[0]=1; for (int i=1;i<=m;++i) pow2[i]=pow2[i-1]*2%Mod;
	bool flag_chain=true;
	if (m!=n-1) flag_chain=false;
	for (int i=1;i<=m;++i){
		int x=read(),y=read();
		E[i].x=x,E[i].y=y;
		if (x>y) swap(x,y);
		if ((x!=i) || (y!=i+1)) flag_chain=false;
		addedge(x,y);
		addedge(y,x);
	}
	Tarjan(1,0);
	Subtask2::Main();
	// cerr<<"MemoryUsed:"<<1.0*abs(&ST-&ED)/1024/1024<<endl;
	return 0;
}











