//I'm stupid. I'll AFO.
#include<bits/stdc++.h>
#define OFFLINE
#define ll long long
#define ull unsigned long long
using namespace std;
const int MAXN=5e5+3;
const ll mod=1e9+7;
ll qpow(ll x,ll y,ll p){
    x%=p;
    ll res=1;
    while(y){ if(y&1){res=res*x%p;}x=x*x%p;y>>=1; }
    return res;
}
int head[MAXN],edge[2*MAXN],Next[MAXN],TOT;
void add(int u,int v){edge[++TOT]=v,Next[TOT]=head[u],head[u]=TOT;}
ll ans;
ll s[MAXN],top;//stack
ll in[MAXN];
ll dfn[MAXN],low[MAXN],cnt,e_dcc[MAXN],CNT,size[MAXN],bridge[2*MAXN];//e_dcc
ll e_dcc_size[MAXN];
ll e_dcc_val[MAXN];
int n,m;
vector<int> graph[MAXN];
void tarjan(int num,int fa){
    dfn[num]=low[num]=++CNT;
    s[++top]=num;
    in[num]=1;
    size[num]=1;
    int tot=0;
    for(int i=head[num];i;i=Next[i]){
        int v=edge[i];
        if(v==fa) continue;
        if(!dfn[v]){
            tarjan(v,num);
            low[num]=min(low[num],low[v]);
            size[num]+=size[v];
        }
        else if(in[v]){
            low[num]=min(low[num],dfn[v]);
        }
        if(dfn[num]<=low[v]){
            bridge[i]=1;
            tot++;
        }
    }
    if(tot){
        cnt++;
        e_dcc_size[cnt]=size[num];
        e_dcc_val[cnt]=qpow(2,size[num],mod)-1;
        do
        {
            in[s[top]]=0;
            e_dcc[s[top--]]=cnt;
        } while (s[top]!=num&&top>0);
        if(top&&s[top]==num) e_dcc[s[top--]]=cnt;
    }
}
void dfs(int num,int fa){
    for(int i=head[num];i;i=Next[i]){
        int v=edge[i];
        if(v==fa) continue;
        if(e_dcc[num]!=e_dcc[v]){
            graph[e_dcc[num]].push_back(e_dcc[v]);
            graph[e_dcc[v]].push_back(e_dcc[num]);
        }
        dfs(v,num);
    }
}
int main(){
#ifdef OFFLINE
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
#endif
    ios::sync_with_stdio(false);
    cin>>n>>m;
    TOT=1;
    for(int i=1;i<=m;i++){
        int u,v;
        cin>>u>>v;
        add(u,v);
        add(v,u);
    }
    // tarjan(1,0);
    // dfs(1,0);
    // for(int i=1;i<=n;i++){
    //     cout<<e_dcc[i]<<"\n";
    // }
    for(ll i=0;i<=m;i++){
        ans=(ans+(n-i)*qpow(2,m-i,mod))%mod;
    }
    cout<<ans<<"\n";
    return 0;
}