#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=x*10+c-48;
		c=getchar();
	}
	return x*f;
}
const int N=5e5+5,mod=1e9+7l;
int n,m,i,j,k,l,o,p,x,y,T,r,a[N],b[N],ans,f[N];
vector<int> g[N];
inline void dfs(int x,int fa){
	if(g[x].size()==1&&g[x][0]==fa){
		f[x]=2;
		return;
	}
	int S=1,s=1;
	for(int i=0;i<g[x].size();i++){
		int to=g[x][i];
		if(to==fa)continue;
		dfs(to,x);
		s=s*f[to]*2%mod;
		S=S*(f[to]+1)%mod;
	}
	f[x]=s+S%mod;
}
signed main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
    n=read();
    m=read();
    p=1;
    if(m==n-1){
    	for(i=1;i<=m;i++){
    	p=p*2%mod;
    	x=read();
    	y=read();
    	g[x].push_back(y);
    	g[y].push_back(x);
	}
	 dfs(1,0);
	 cout<<(f[1]-p+mod)%mod;
	 return 0;
	}
	return 0;
}