#include typedef uint64_t u64; typedef int64_t i64; using namespace std; template struct modint{ u64 val; modint(i64 val_=0):val((val_%i64(mod)+i64(mod))%i64(mod)){} modint operator-(){ return (val==0)?0:mod-val; } modint operator+(modint rhs){ return modint(*this)+=rhs; } modint operator-(modint rhs){ return modint(*this)-=rhs; } modint operator*(modint rhs){ return modint(*this)*=rhs; } modint operator/(modint rhs){ return modint(*this)/=rhs; } modint pow(i64 rhs){ modint res=1,now=(*this); while(rhs){ res*=((rhs&1)?now:1),now*=now,rhs>>=1; } return res; } modint &operator+=(modint rhs){ val+=rhs.val,val-=((val>=mod)?mod:0); return (*this); } modint &operator-=(modint rhs){ val+=((val>(std::istream& is,modint& x){ u64 t; is>>t,x=t; return is; } }; int main(){ constexpr u64 mod=1000000007; typedef modint mint; mint hf=(mod+1)/2; int N,M; cin>>N>>M; vector root(N),siz(N,1); vector prob(N,1); vector> par(N); for(int i=0;i>a>>b; a--,b--; a=root[a],b=root[b]; if(siz[a]siz[b]){ siz[a]=siz[a]+siz[b]; for(auto v:par[b]){ root[v]=a; prob[v]=0; par[a].emplace_back(v); } } else{ siz[a]=siz[a]+siz[b]; for(auto v:par[a]){ prob[v]*=hf; } for(auto v:par[b]){ root[v]=a; prob[v]*=hf; par[a].emplace_back(v); } } } for(auto v:prob){ cout<