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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
    ost<<"{"<<p.first<<","<<p.second<<"}";
    return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
    ost<<"{";
    for(int i=0;i<v.size();i++){
        if(i)ost<<",";
        ost<<v[i];
    }
    ost<<"}";
    return ost;
}

int N,M;
vpint G[22];

int par[22],dep[22],id[22];
void dfs(int v,int p,int d){
    par[v]=p;
    dep[v]=d;
    for(auto &e:G[v]){
        if(e.fi==p)continue;
        id[e.fi]=e.se;
        dfs(e.fi,v,d+1);
    }
}

template<class T>
inline void FastZetaTransformSubset(vector<T>&f,function<T(T,T)>add){
    int n=__lg(f.size());
    for(int i=0;i<n;i++){
        for(int j=0;j<1<<n;j++){
            if(~j>>i&1)f[j|1<<i]=add(f[j|1<<i],f[j]);
        }
    }
}

template<uint32_t mod>
struct ModInt{
    uint32_t a;
    ModInt& s(uint32_t vv){
        a=vv<mod?vv:vv-mod;
        return *this;
    }

    ModInt(int64_t x=0){s(x%mod+mod);}

    ModInt& operator+=(const ModInt &x){return s(a+x.a);}
    ModInt& operator-=(const ModInt &x){return s(a+mod-x.a);}
    ModInt& operator*=(const ModInt &x){
        a=uint64_t(a)*x.a%mod;
        return *this;
    }
    ModInt& operator/=(const ModInt &x){
        *this*=x.inv();
        return *this;
    }

    ModInt operator+(const ModInt &x)const{return ModInt(*this)+=x;}
    ModInt operator-(const ModInt &x)const{return ModInt(*this)-=x;}
    ModInt operator*(const ModInt &x)const{return ModInt(*this)*=x;}
    ModInt operator/(const ModInt &x)const{return ModInt(*this)/=x;}
    bool operator==(const ModInt &x)const{return a==x.a;}
    bool operator!=(const ModInt &x)const{return a!=x.a;}
    bool operator<(const ModInt &x)const{return a<x.a;}

    ModInt operator-()const{return ModInt()-*this;}
    ModInt pow(int64_t n)const{
        ModInt res(1),x(*this);
        while(n){
            if(n&1)res*=x;
            x*=x;
            n>>=1;
        }
        return res;
    }

    ModInt inv()const{return pow(mod-2);}
};

template<uint32_t mod>
istream& operator>>(istream& in,const ModInt<mod>& a){
    return (in>>a.a);
}
template<uint32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
    return (out<<a.a);
}
using mint=ModInt<1000000007>;

template<class Mint,int32_t lg>
struct ModIntTable{
    int N;
    vector<Mint>facts,finvs,invs;
    ModIntTable():N(1<<lg),facts(N),finvs(N),invs(N){
        const uint32_t mod=Mint(-1).a+1;
        invs[1]=1;
        for(int i=2;i<N;i++)invs[i]=invs[mod%i]*(mod-mod/i);

        facts[0]=1;
        finvs[0]=1;
        for(int i=1;i<N;i++){
            facts[i]=facts[i-1]*i;
            finvs[i]=finvs[i-1]*invs[i];
        }
    }
    inline Mint fact(int n)const{return facts[n];}
    inline Mint finv(int n)const{return finvs[n];}
    inline Mint inv(int n)const{return invs[n];}
    inline Mint binom(int n,int k)const{
        if(n<k||k<0)return 0;
        return facts[n]*finvs[k]*finvs[n-k];
    }
    inline Mint perm(int n,int k)const{
        if(n<k||k<0)return 0;
        return facts[n]*finvs[n-k];
    } 
};
ModIntTable<mint,19>mtable;

mint dp[1<<19][3];

signed main(){
    scanf("%lld%lld",&N,&M);
    rep(i,N-1){
        int a,b;
        scanf("%lld%lld",&a,&b);
        a--;b--;
        G[a].eb(b,i);G[b].eb(a,i);
    }
    dfs(0,-1,0);
    
    vint cnt(1<<(N-1));
    for(int i=N-1;i<M;i++){
        int a,b;
        scanf("%lld%lld",&a,&b);
        a--;b--;
        int mask=0;
        while(a!=b){
            if(dep[a]<dep[b])swap(a,b);
            mask|=1<<id[a];
            a=par[a];
        }
        cnt[mask]++;
    }

    
    function<int(int,int)>ad=[](int a,int b){return a+b;};
    FastZetaTransformSubset(cnt,ad);


    dp[0][0]=1;
    rep(i,1<<(N-1)){
        int e=__builtin_popcount(i);
        int cap=M-e-cnt[i];

        rep(j,N-1){
            if(i>>j&1)continue;
            int nb=i|(1<<j);
            int nx=cnt[nb]-cnt[i];

            dp[nb][2]+=dp[i][2]*mtable.perm(cap-1,nx);
            dp[nb][2]+=dp[i][1]*mtable.perm(cap+1-2,nx)*(N-1-e);
            dp[nb][1]+=dp[i][1]*mtable.perm(cap+1-1,nx);
            dp[nb][2]+=dp[i][0]*mtable.perm(cap-1,nx)*(N-1-e);
            dp[nb][1]+=dp[i][0]*mtable.perm(cap-1,nx-1)*nx;
            dp[nb][0]+=dp[i][0]*mtable.perm(cap-1,nx);
        }
    }

    cout<<dp[(1<<(N-1))-1][2]<<endl;
    return 0;
}

Measured memory_bytes: 18688