#include <bits/stdc++.h>
using namespace std;
const unsigned mod=1000000007;

unsigned short n,m,ui,vi;
unsigned long long sum=0;

vector<unsigned short> g[int(5e5)];

inline unsigned long long pow2(unsigned long long x){
    unsigned long long y=1;
    while(x){
        y=(y<<1)%mod;
        --x;
    }
    return y;
}

int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
    cin>>n>>m;
    for(unsigned _i=0;_i<m;++_i){
        cin>>ui>>vi;
        g[ui].push_back(vi);
        g[vi].push_back(ui);
    }
    sum+=n%mod*(pow2(m)%mod);
    sum++;
    sum=sum<<1;
    sum%=mod;
    cout<<sum;
}
