#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define i64 long long
inline int read(void) {
    int sgn=1,x=0; char c=getchar();
    while(c<'0'||c>'9') { (c=='-'&&(sgn=0)); c=getchar(); }
    while('0'<=c&&c<='9') x=x*10+c-'0',c=getchar();
    return sgn ? x : -x;
}
void write(int x) {
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10),x%=10;
    putchar(x+'0');
}
const int p=1000000007;
inline int ksm(int x,int a=p-2) {
    int res=1;
    for(; a; a>>=1,x=1ll*x*x%p) (a&1) && (res=1ll*res*x%p);
    return res;
}
int n,m; i64 Ans;
int s[1000006],t[1000006];
vector <int> E[500005];
vector <int> T[500005];
int dfn[500005],low[500005],vis[500005],scc[500005],cntdfn,cntscc,stk[500005],top;
int siz[500005],cntE[500005];
i64 pw2[1000006];
void tarjan(int x,int fa) {
    dfn[x]=low[x]=++cntdfn;
    vis[x]=1; stk[++top]=x;
    for(int v : E[x]) {
        if(v==fa) continue;
        if(!dfn[v]) {
            tarjan(v,x);
            low[x]=min(low[x],low[v]);
        } else if(vis[v]) {
            low[x]=min(low[x],dfn[v]);
        } 
    }
    if(low[x]>=dfn[x]) {
        ++cntscc;
        while(stk[top]!=x) {
            scc[stk[top]]=cntscc;
            vis[stk[top]]=0;
            ++siz[cntscc];
            --top;
        }
        scc[stk[top]]=cntscc;
        vis[stk[top]]=0;
        --top;
        ++siz[cntscc];
    }
}
int f[500005][2];
void dfs(int x,int fa) {
    i64 prod0=1,sum1=0,prod2=1; int cnts=0;
    for(int v : T[x]) {
        if(v==fa) continue;
        dfs(v,x); ++cnts;
        cntE[x]=cntE[x]+cntE[v]+1;
        prod0=prod0*f[v][0]%p;
        prod2=prod2*(f[v][0]*2ll+f[v][1])%p;
    }
    for(int v : T[x]) {
        if(v==fa) continue;
        sum1=(sum1+prod0*ksm(f[v][0])%p*f[v][1])%p;
    }
    f[x][0]=pw2[cnts]*prod0;
    f[x][1]=((prod2*pw2[siz[x]]-pw2[cnts]*prod0-pw2[cnts-1]*sum1)%p+p)%p;
    Ans=(Ans+pw2[cntscc-1-cntE[x]]*f[x][1])%p;
    f[x][1]=(f[x][1]+pw2[cnts-1]*sum1)%p;
}
signed main() {
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    n=read(); m=read();
    pw2[0]=1;
    for(int i=1; i<=m; ++i) (pw2[i]=pw2[i-1]<<1)>=p && (pw2[i]-=p);
    for(int i=1,x,y; i<=m; ++i) {
        s[i]=x=read(); t[i]=y=read();
        E[x].push_back(y);
        E[y].push_back(x);
    } 
    tarjan(1,0);
    // cout<<"scc "<<cntscc<<endl;
    // for(int i=1; i<=n; ++i) cout<<scc[i]<<' '; puts("");
    // for(int i=1; i<=n; ++i) cout<<dfn[i]<<' '; puts("");
    // for(int i=1; i<=n; ++i) cout<<low[i]<<' '; puts("");
    for(int i=1; i<=m; ++i) {
        if(scc[s[i]]!=scc[t[i]]) {
            T[scc[s[i]]].push_back(scc[t[i]]);
            T[scc[t[i]]].push_back(scc[s[i]]);
        }
    }
    dfs(1,0);

    write(Ans*pw2[m-(cntscc-1)]%p); puts("");
    return 0;
}