#include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define MOD 1000000007

int n,m;
vector<pii> tree[25];
int cnt[1<<19];
pii dp[1<<19];
int ppc[1<<19];

int dfs(int s, int t, int bef, int msk){
    if(s==t)return msk;
    for(pii P : tree[s]){
        int to = P.first;
        if(to==bef)continue;
        int ret = dfs(to,t,s,msk | (1<<P.second));
        if(ret != -1)return ret;
    }
    return -1;
}

int main(){
    scanf("%d%d",&n,&m);
    n--;
    REP(i,m){
        int a,b;
        scanf("%d%d",&a,&b);
        --a;--b;
        if(i<n){
            tree[a].push_back(pii(b,i));
            tree[b].push_back(pii(a,i));
        }else{
            int msk = dfs(a,b,-1,0);
            cnt[msk]++;
        }
    }
    REP(j,n)REP(i,1<<n)if(i&(1<<j))cnt[i]+=cnt[i^(1<<j)];
    REP(i,1<<n)ppc[i] = __builtin_popcount(i);
    dp[0] = pii(1,0);
    REP(j,m-n+1){
        REP(msk,1<<n)if(dp[msk] != pii(0,0)){
            int v = ppc[msk] + j + 1;
            int rmsk = ~msk & ((1<<n)-1);
            int add = (dp[msk].second + 1ll*dp[msk].first*v) % MOD;
            for(int x=rmsk&-rmsk; x; x=rmsk&(~rmsk+(x<<1))){
                (dp[msk | x].first += dp[msk].first) %= MOD;
                (dp[msk | x].second += add) %= MOD;
            }
        }
        if(j==m-n)break;
        REP(msk,1<<n)if(dp[msk] != pii(0,0)){
            dp[msk].first = 1ll*dp[msk].first *(cnt[msk]-j) % MOD;
            dp[msk].second= 1ll*dp[msk].second*(cnt[msk]-j) % MOD;
        }
    }
    printf("%d\n",dp[(1<<n)-1].second);
    return 0;
}
