#include<bits/stdc++.h>
using namespace std;
#define ll long long

inline int read()
{
    int x=0,f=1;char s=getchar();
    while(s<'0'||s>'9')
    {
        if(s=='-') f=-1;
        s=getchar();
    }
    while(s>='0'&&s<='9')
    {
        x=x*10+s-'0';
        s=getchar();
    }
    return x*f;
}

const int p=1e9+7;

inline int add(int a,int b)
{
    return a+b>=p?a+b-p:a+b;
}

inline int sub(int a,int b)
{
    return a-b<0?a-b+p:a-b;
}

int n,m;
const int N=5e5+5,M=1e6+5;
pair<int,int> eg[M];
int ve[M];
int cnt,dfn[N],low[N],id[N];
vector<pair<int,int> > e1[N];
vector<int> e2[N];
int fa[N];
int sze[N],sume[N],dp[N],sz[N],pw[M<<1];

void tarjan(int u,int fa,int id)
{
    dfn[u]=low[u]=++cnt;
    for(auto x:e1[u])
    {
        int v=x.first,i=x.second;
        if(v==fa) continue;
        if(!dfn[v]) tarjan(v,u,i);
        low[u]=min(low[u],low[v]);
    }
    if(low[u]==dfn[u]&&u!=1) ve[id]=1;
}

inline int getfa(int x)
{
    return x==fa[x]?x:fa[x]=getfa(fa[x]);
}

void dfs(int u,int fa)
{
    sume[u]=sze[u];
    int s1=0,s3=1;
    for(int v:e2[u])
    {
        if(v==fa) continue;
        dfs(v,u);
        sume[u]+=1+sume[v];
        s3=1ll*s3*add(dp[v],pw[sume[v]+1])%p;
        s1++;
    }
    if(s1==0)
    {
        dp[u]=1ll*pw[sume[u]]*sub(pw[sz[u]],1)%p;
        return;
    }
    dp[u]=1ll*s3*pw[sz[u]]%p*pw[sze[u]]%p;
    dp[u]=sub(dp[u],pw[sume[u]]);
}

int ans=0;
void dfs2(int u,int fa)
{
    ans=add(ans,1ll*dp[u]*pw[(sume[1]-sume[u]-(u!=1?1:0))]%p);
    for(int v:e2[u])
    {
        if(v==fa) continue;
        dfs2(v,u);
    }
}

int main()
{
    freopen("barrack.in","r",stdin);
    freopen("barrack.out","w",stdout);
    n=read(),m=read();
    for(int i=1;i<=m;i++)
    {
        int a=read(),b=read();
        eg[i]=make_pair(a,b);
        e1[a].push_back(make_pair(b,i));
        e1[b].push_back(make_pair(a,i));
    }
    pw[0]=1;
    for(int i=1;i<=m;i++) pw[i]=add(pw[i-1],pw[i-1]);
    tarjan(1,0,0);
    for(int i=1;i<=n;i++) fa[i]=i;
    for(int i=1;i<=m;i++)
    {
        if(ve[i]) continue;
        int u=eg[i].first,v=eg[i].second;
        int t1=getfa(u),t2=getfa(v);
        if(t1==t2) continue;
        fa[t1]=t2;
    }
    int tot=0;
    for(int i=1;i<=n;i++)
    {
        int t=getfa(i);
        if(!id[t]) id[t]=++tot;
        sz[id[t]]++;
    }
    //cout<<tot<<endl;
    for(int i=1;i<=m;i++)
    {
        int u=eg[i].first,v=eg[i].second;
        int t1=getfa(u),t2=getfa(v);
        if(!ve[i]) sze[id[t1]]++;
        else
        {
            int a=id[t1],b=id[t2];
            e2[a].push_back(b);
            e2[b].push_back(a);
        }
    }
    dfs(1,0);
    dfs2(1,0);
    printf("%d\n",ans);
    return 0;
}
