#define ssh(x)<x>
#include ssh(bits/stdc++.h)
#define rfor(x...)for(register x)
#define rep(i,l,r)rfor(ll i=l;i<=r;i++)
#define ref(i,l,r)rfor(ll i=l;i<r;i++)
#define per(i,l,r)rfor(ll i=l;i>=r;i--)
#define rev(i,u,v)rfor(ll i=head[u],v;v=to[i],i;i=next[i])
#define rej(i,s)rfor(ll i=s;i;i=(i-1)&(s))
#define re0(i,s)rfor(ll i=s;~i;i=i?(i-1)&(s)):-1)
#define red(i,n)rfor(ll i=n;i;i>>=1)
#define IO(x...)((*#x!='/'||#x[1])&&(*#x&&freopen(#x".in","r",stdin)&&freopen(#x".out","w",stdout),gc=fgc,pc=fpc,atexit(fout)))
typedef long long ll;
typedef const ll cll;
typedef unsigned long long ull;
cll N=4e6+7,mod=1e9+7,iv2=(mod+1)/2,iz=1<<21,oz=1<<22;
typedef ll aN[N];
char is[iz],*i1=is,*i2=is,os[oz],*o1=os,*o2=os+oz;
int fgc(){
    return i1==i2&&is==(i2=is+fread(i1=is,1,iz,stdin))?-1:*i1++;
}
void fout(){
    fwrite(os,o1-os,1,stdout),o1=os;
}
int fpc(int c){
    if(o1==o2)fout();
    return*o1++=c;
}
int(*gc)()=getchar,(*pc)(int)=putchar,wt[126];
int readchar(int l=33,int r=126){
    if(l>r)std::swap(l,r);
    int c=gc();
    for(;c<l||c>r;c=gc());
    return c;
}
ll readll(){
    ll x=0,w=1;
    int c=gc();
    for(;c<48||c>57;c=gc())c-45||(w=-w);
    for(;c>47&&c<58;c=gc())x=x*10+c-48;
    return x*w;
}
void writell(cll u,int c=32){
    int t=0;
    rfor(ull n=u<0?pc(45),0ull-u:u;n;n/=10)wt[++t]=n%10^48;
    for(t||pc(48);t;)pc(wt[t--]);
    c&&pc(c);
}
int mygets(char*s,int c=0){
    char*t=s+1;
    while((*s=gc())<33);
    while((*t=gc())>32)t++;
    c&&(*t++=c),*t=0;
    return t-s;
}
int myputs(const char*s,int c=10){
    const char*t=s;
    while(*t)pc(*t++);
    c&&pc(c);
    return t-s+(c!=0);
}
cll IO_res=IO(barrack),T=1;
void init(){
}
aN next,to,head,sz,sz_e,f,g;
ll cnt;
void add(cll u,cll v){
    next[++cnt]=head[u],to[head[u]=cnt]=v;
}
aN p2;
void dfs(cll u,cll fa){
    sz[u]=1,f[u]=2,g[u]=1;
    rev(i,u,v)if(v^fa)dfs(v,u),sz[u]+=sz[v],f[u]=(f[u]*f[v]+f[u]*(p2[sz[v]-1]))%mod,g[u]=(g[u]*g[v]+g[u]*(p2[sz[v]-1]))%mod;
    //fprintf(stderr,"%lld %lld %lld\n",u,g[u],f[u]);
}
aN dfn,low,st,col,d,e;
ll top,ts,cl;
void dfs2(cll u,cll fa){
    //fprintf(stderr,"%lld %lld\n",u,fa);
    dfn[u]=low[u]=++top,st[++ts]=u;
    rev(i,u,v)if(!dfn[v])dfs2(v,u),low[u]=std::min(low[v],low[u]);
    else if(v!=fa&&!col[v])low[u]=std::min(dfn[v],low[u]);
    if(dfn[u]==low[u])for(col[st[ts--]]=++cl;st[ts+1]!=u;col[st[ts--]]=cl);
    //fprintf(stderr,"==%lld\n",st[ts]);
}
void dfsz(cll u,cll fa){
    sz[u]=d[u],sz_e[u]=e[u],f[u]=p2[d[u]]*p2[e[u]]%mod,g[u]=p2[e[u]];
    rev(i,u,v)if(v^fa)dfsz(v,u),sz[u]+=sz[v],sz_e[u]+=sz_e[v]+1,f[u]=(f[u]*f[v]+f[u]*(p2[sz_e[v]]))%mod,g[u]=(g[u]*g[v]+g[u]*(p2[sz_e[v]]))%mod;
    //fprintf(stderr,"%lld %lld %lld %lld %lld\n",u,d[u],e[u],g[u],f[u]);
}
void calc(){
    cll n=readll(),m=readll();
    rep(i,1,m){
        cll u=readll(),v=readll();
        add(u,v),add(v,u);
    }
    ll x=1;
    rep(i,0,m)p2[i]=x,x=x*2%mod;
    if(m==n-1){
        dfs(1,0);
        ll sum=0;
        rep(i,1,n)sum=(sum+(f[i]-g[i]+mod)*(i==1?1:p2[n-1-sz[i]]))%mod;
        writell(sum,10);
    }else{
        dfs2(1,0);
        //rep(i,1,n)writell(col[i],10);
        //exit(0);
        rep(i,1,n)d[col[i]+n]++;
        rep(u,1,n)rev(i,u,v)if(col[u]==col[v])e[col[u]+n]+=u<=v;
        else add(col[u]+n,col[v]+n);
        dfsz(n+col[1],0);
        ll sum=0;
        rep(i,n+1,n+cl)sum=(sum+(f[i]-g[i]+mod)*(i==col[1]+n?1:p2[m-1-sz_e[i]]))%mod;//,fprintf(stderr,"%lld\n",(f[i]-g[i]+mod));
        writell(sum,10);
    }
}
int main(){
    init();
    rep(i,1,T)calc();
    return 0;
}
/*
3 2
1 2
1 3
*/
