#include<bits/stdc++.h>
using namespace std;
const int N=1000001,mo=1e9+7;
vector<int>e[N],g[N];
int dfn[N],low[N],bel[N],cc,cnt[N],cnte[N],sum_cnte[N],ans=0;
vector<int>st;
int bs[N];
int idx;
void tarjan(int x,int fa){
    dfn[x]=low[x]=++idx;
    st.push_back(x);
    for(auto v:e[x]){
        if(v!=fa){
            if(!dfn[v]){
                tarjan(v,x);
                low[x]=min(low[x],low[v]);
            }
            else{
                low[x]=min(low[x],dfn[v]);
            }
        }
    }
    if(low[x]==dfn[x]){
        ++cc;
        bel[x]=cc;
        cnt[cc]=1;
        while(st.back()!=x){
            int w=st.back();
            bel[w]=cc;
            cnt[cc]++;
            st.pop_back();
        }
        st.pop_back();
    }
}



int f[N],uf[N];

int calc(int p,int e){
    return 1ll*(bs[p]+mo-1)%mo*bs[e]%mo;
}

int vac(int x){
    return bs[x];
}

void dfs(int x,int fa){
    sum_cnte[x]=cnte[x];
    int rem=vac(cnte[x]);
    f[x]=calc(cnt[x],cnte[x])+vac(cnte[x]);

    for(auto v:g[x]){
        if(v!=fa){
            dfs(v,x);
            sum_cnte[x]+=sum_cnte[v]+1;
        
            f[x]=1ll*f[x]*((f[v]+vac(sum_cnte[v]+1))%mo)%mo;
            rem=1ll*rem*vac(sum_cnte[v]+1)%mo;
        }
    }

    f[x]=(f[x]+mo-rem)%mo;
    uf[x]=f[x];
    for(auto v:g[x]){
        if(v!=fa){
            uf[x]=(uf[x]+1ll*(2*uf[v]%mo-f[v]+mo)%mo*vac(sum_cnte[x]-sum_cnte[v]-1)%mo)%mo;
        }
    }
}

int main(){
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    bs[0]=1;
    for(int i=1;i<N;i++){
        bs[i]=bs[i-1]*2%mo;
    }
    int n,m;
    scanf("%d%d",&n,&m);
    vector<pair<int,int>>ed;
    for(int i=1;i<=m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        e[x].push_back(y);
        e[y].push_back(x);
        ed.push_back({x,y});
    }
    for(int i=1;i<=n;i++){
        if(!dfn[i])tarjan(i,0);
    }
    for(auto v:ed){
        int x=v.first,y=v.second;
        if(bel[x]==bel[y]){
            cnte[bel[x]]++;
        }
        else{
            g[bel[x]].push_back(bel[y]);
            g[bel[y]].push_back(bel[x]);
        }
    }
    int rt=1;
    dfs(rt,0);
    printf("%d\n",uf[rt]);
}
