// NOIP2022 RP++

#include <bits/stdc++.h>
typedef unsigned uint;
typedef unsigned long long ullt;typedef long long llt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _min(T&a,T b){return b<a?(a=b,true):false;}
template<typename T>bol _max(T&a,T b){return a<b?(a=b,true):false;}
const ullt Mod=1e9+7;
struct modint{
    ullt v;
    ullt&operator()(){return v;}
    modint():v(0){}
    modint(ullt v):v(v%Mod){}
    friend modint operator+(modint a,modint b){return a()+b();}
    friend modint operator-(modint a,modint b){return a()+Mod-b();}
    friend modint operator*(modint a,modint b){return a()*b();}
    voi read(){scanf("%llu",&v),v%=Mod;}
    voi print(){printf("%llu",v);}
    voi println(){print(),putchar('\n');}
    modint&operator+=(modint b){return*this=*this+b;}
    modint&operator-=(modint b){return*this=*this-b;}
    modint&operator*=(modint b){return*this=*this*b;}
};
uint Dfn[1000005],cnt;
uint Val[1000005];
std::vector<uint>Way0[1000005],Son0[1000005];
voi dfs1(uint p,uint f){
    Dfn[p]=cnt++;
    for(auto s:Way0[p])if(s!=f){
        if(~Dfn[s]){
            if(Dfn[s]<Dfn[p])Val[s]--,Val[p]++;
            continue;
        }
        dfs1(s,p);
        Val[p]+=Val[s];
        Son0[p].push_back(s);
    }
}
uint Own[1000005],Cnt[1000005];
std::vector<uint>Way[1000005];
uint t;
voi dfs2(uint p,uint f){
    if(Val[p])Own[p]=Own[f];
    else{
        Own[p]=t++;
        if(~f)Way[Own[p]].push_back(Own[f]),Way[Own[f]].push_back(Own[p]);
    }
    Cnt[Own[p]]++;
    for(auto s:Son0[p])
        dfs2(s,p);
}
modint Pow2[1000005];
modint Dp[3][1000005];
voi dp(uint p,uint f){
    Dp[0][p]=1,Dp[2][p]=Pow2[Cnt[p]];
    std::vector<modint>Pre{1},Suf;
    for(auto s:Way[p])if(s!=f){
        dp(s,p);
        Pre.push_back(Pre.back()*2*Dp[0][s]);
        Suf.push_back(2*Dp[0][s]);
        Dp[0][p]*=2*Dp[0][s];
        Dp[2][p]*=2*Dp[0][s]+Dp[2][s];
    }
    Suf.push_back(1);
    for(uint i=Suf.size()-1;i;i--)
        Suf[i-1]*=Suf[i];
    Dp[1][p]=Dp[2][p]-=Dp[0][p];
    uint w=0;
    for(auto s:Way[p])if(s!=f)
        Dp[1][p]=Dp[1][p]+(2*Dp[1][s]-Dp[2][s])*Pre[w]*Suf[w+1],w++;
}
int main(){
#ifdef MYEE
    freopen("QAQ.in","r",stdin);
    freopen("QAQ.out","w",stdout);
#else
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
#endif
    Pow2[0]=1;for(uint i=1;i<=1000000;i++)Pow2[i]=Pow2[i-1]*2;
    uint n,m;scanf("%u%u",&n,&m);
    for(uint i=0;i<n;i++)Dfn[i]=-1;
    for(uint i=0;i<m;i++){
        uint u,v;
        scanf("%u%u",&u,&v);
        Way0[--u].push_back(--v);
        Way0[v].push_back(u);
    }
    dfs1(0,-1);
    // for(uint i=0;i<n;i++)printf("%u%c",Val[i]," \n"[i==n-1]);
    dfs2(0,-1);
    // printf("%u\n",t);
    modint s=Pow2[m-(t-1)];
    dp(0,-1);
    modint ans=s*Dp[1][0];
    ans.println();
    return 0;
}

/*
g++ barrack.cpp -o barrack -DMYEE -Wall -std=c++11
biu#2019miss
solo@2022
*/
