/*
I have known that there is how much 2-Cl-circle-6-CH2
But this place is too small that I can't write them down all!	-F11
2023.1.6&2023.1.8 Fighting!!!
*/
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define REP(i,a,b) for(int i=a;i>=b;i--)

int n,m;

const int mod=1e9+7;

void work1(){
	FOR(i,1,m){
		int u,v;
		scanf("%d%d",&u,&v);
	}
	if(n==1){
		cout<<0;
		return;
	}
	if(n==2){
		cout<<5;
		return;
	}
	if(n==3){
		cout<<18;
		return;
	}
	if(n==4){
		cout<<56;
		return;
	}
	if(n==5){
		cout<<160;
		return;
	}
	if(n==6){
		cout<<414;
		return;
	}
	int x=n-1;
	FOR(i,1,n){
		x=x*2%mod;
	}
	int y=1;
	FOR(i,1,2*n-5){
		y=y*2%mod;
	}
	x=x*y%mod;
	cout<<x;
}

int main(){
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	
	cin>>n>>m;
	if(m==n-1){
		work1();
		return 0;
	}
	
	return 0;
}