#include<bits/stdc++.h>
#define poly vector<int>
#define ll long long 
#define pa pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define IOS ios::sync_with_stdio(false)
#define N 1000005
#define mod 1000000007
#define int ll
using namespace std;
mt19937_64 rnd(time(0));
int dfn[N],DFN;
int low[N];
map<pa,int>Mp;
int col[N],tot;
int dp[N][2];
int pw[N];
int siz[N];
int totn[N];
poly S[N];
int tote;
int n,m;
int ans;
poly G[N];
void tarjan(int k,int fa)
{
    dfn[k]=++DFN;
    low[k]=dfn[k];
    for (auto u:G[k])
    {
        if (u==fa) continue;
        if (!dfn[u])
        {
            tarjan(u,k);
            low[k]=min(low[k],low[u]);
            if (low[u]>dfn[k])
            {
                Mp[mp(min(u,k),max(u,k))]=1;
            }
        } else low[k]=min(low[k],low[u]);
    }
}
void dfs(int k,int fa)
{
    col[k]=tot;
    for (auto u:G[k])
    {
        if (col[u]) continue;
        int x=min(u,k),y=max(u,k);
        if (!Mp.count(mp(x,y)))
            dfs(u,k);
    }
}
void dfs1(int k,int fa)
{
    dp[k][1]=1;
    dp[k][0]=1;
    siz[k]=1;
    int x=1,y=1;
    for (auto u:S[k])
    {
        if (u==fa) continue;
        dfs1(u,k);
        siz[k]+=siz[u];
        dp[k][1]=(dp[k][1]*(dp[u][1]+dp[u][0]*2%mod)%mod)%mod;
        dp[k][0]=(dp[k][0]*dp[u][0]*2%mod)%mod;
    }
    dp[k][1]=(dp[k][1]-dp[k][0]+mod)%mod;
    dp[k][1]=dp[k][1]*pw[totn[k]]%mod;
    dp[k][1]=(dp[k][1]+dp[k][0]*(pw[totn[k]]-1)%mod)%mod;
    int Wa=1;
    if (fa) Wa=pw[tot-siz[k]-1]%mod;
    ans=(ans+dp[k][1]*Wa%mod)%mod;
}
void BellaKira()
{
    ans=0;
    pw[0]=1;
    for (int i=1;i<N;i++) pw[i]=pw[i-1]*2%mod;
    cin>>n>>m;
    for (int i=1;i<=m;i++)
    {
        int x,y;
        cin>>x>>y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    for (int i=1;i<=n;i++)
        if (!dfn[i]) tarjan(i,0);
    for (int i=1;i<=n;i++)
        if (!col[i]) ++tot,dfs(i,0);
    int tt=0;
    map<pa,int>F;
    for (int i=1;i<=n;i++)
    {
        totn[col[i]]++;
        for (auto u:G[i])
            if (col[u]!=col[i])
            {
                if (!F.count(mp(col[i],col[u]))) S[col[i]].push_back(col[u]);
                tt++;
            }
    }
    tote=m-Mp.size();
    dfs1(1,0);
    cout<<ans*pw[tote]%mod<<'\n';
}
signed main()
{
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    IOS && cin.tie(0);
    int T=1;
    while (T--)
    {
        BellaKira();
    }
}