#include<bits/stdc++.h>
using namespace std;
#define int long long 
const int md=1e9+7;
#define ins(x,y) E[x].push_back(y)
int read()
{
    int x=0;bool f=0;char c=getchar();
    for(;!isdigit(c);c=getchar())f^=!(c-45);
    for(;isdigit(c);c=getchar())x=x*10+c-48;
    if(f)x=-x;return x;
}
int n,m;
int cnt=1;
struct edge
{
    int v,w,nt;
}e[2006000];
struct abc
{
    int x,y;
}u[2000500];
int cut[2000060],vis[500500],pw[2500005],ans;
vector<int>E[500500];
int head[500500],dfn[500500],low[500500],col[500500],cpt,cct,sum[500500],ss[500500];
void add(int u,int v)
{
    e[++cnt]={v,0,head[u]};
    head[u]=cnt;
}
void tarjan(int x,int fa)
{
    dfn[x]=low[x]=++cct;
    for(int i=head[x];i;i=e[i].nt)
    {
        int y=e[i].v;
        if(!dfn[y])
        {
            tarjan(y,i);
            low[x]=min(low[x],low[y]);
            if(low[y]>dfn[x])
            {
                e[i].w=e[i^1].w=1;
            }
        }
        else if(i!=(fa^1))low[x]=min(low[x],dfn[y]);
    }
}
void dfs(int x,int fa)
{
    col[x]=cpt;sum[cpt]++;
    for(int i=head[x];i;i=e[i].nt)
    {
        int y=e[i].v;
        if(y==fa||e[i].w||col[y])continue;
        dfs(y,x);
    }
}
int dp[500500][2],siz[500500];
int sig,mi,rt;
void frt(int x,int fa)
{
    int res=0;
    for(auto y:E[x])
    {
        if(y==fa||vis[y])continue;
        frt(y,x);
        siz[x]+=siz[y];
        res=max(res,siz[y]);
    }
    res=max(res,sig-siz[x]);
    if(res<mi)mi=res,rt=x;
}
void dfs0(int x,int fa)
{
    siz[x]=1;
    dp[x][0]=1,dp[x][1]=(pw[sum[x]]-1+md)%md;
    for(auto y:E[x])
    {
        if(y!=fa&&!vis[y])
        {
            dfs0(y,x);
            siz[x]+=siz[y];
            dp[x][1]=(dp[x][1]*(dp[y][0])*2+(dp[x][0]+dp[x][1])*dp[y][1])%md;
            dp[x][0]=dp[x][0]*dp[y][0]*2%md;
        }
    }
}
void dfss(int x)
{
    vis[x]=1;siz[x]=1;
    int res=(pw[sum[x]]-1+md)%md;
    int g[3];g[0]=g[1]=g[2]=0,g[0]=1;
    for(auto y:E[x])if(!vis[y])
    {
        dfs0(y,x);
        siz[x]+=siz[y];
        res=res*(dp[y][0]*2+dp[y][1])%md;
        g[2]=(g[2]*(dp[y][0]*2%md+dp[y][1])+(dp[y][1]*g[1])%md)%md;
        g[1]=(g[1]*dp[y][0]*2+g[0]*dp[y][1])%md;
        g[0]=g[0]*dp[y][0]*2%md;
    }
    ans=(ans+(res+g[2])*pw[(cpt-siz[x])]%md)%md;
    for(auto y:E[x])if(!vis[y])
    {
        sig=siz[y];
        mi=0x3f3f3f3f;
        frt(y,x);
        dfss(rt);
    }
}
signed main()
{
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    n=read(),m=read();
    pw[0]=1;
    for(int i=1;i<=2500000;i++)pw[i]=pw[i-1]*2%md;
    for(int i=1;i<=m;i++)
    {
        int x=read(),y=read();
        add(x,y),add(y,x);
        u[i]={x,y};
    }
    
    tarjan(1,0);
    for(int i=1;i<=n;i++)
        if(!col[i])
            cpt++,dfs(i,0);
    int pz=1;
    for(int i=1;i<=m;i++)
    {
        int x=u[i].x,y=u[i].y;
        if(col[x]==col[y])ss[col[x]]++,pz=pz*2%md;
        else ins(col[x],col[y]),ins(col[y],col[x]);
    }
    sig=cpt,mi=0x3f3f3f3f;
    frt(1,0);
    dfss(rt);
    cout<<pz*ans%md;
    return 0;
}