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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	vector<vector<int>> adj(n);
	vector<pair<int, int>> T(n - 1);
	vector<pair<int, int>> B(m - n + 1);
	int state = 0;
	function<bool(int, int, int)> dfs = [&](int u, int p, int x) {
		if (u == x) {
			return true;
		}
		for (int e : adj[u]) {
			int v = T[e].first ^ T[e].second ^ u;
			if (v == p) {
				continue;
			}
			if (dfs(v, u, x)) {
				state |= 1 << e;
				return true;
			}
		}
		return false;
	};
	vector<int> cnt(1 << (n - 1), 0);
	for (int i = 0; i < m; i++) {
		int u, v; cin >> u >> v;
		u--, v--;
		if (i < n - 1) {
			adj[u].push_back(i);
			adj[v].push_back(i);
			T[i] = {u, v};
		} else {
			state = 0;
			assert(dfs(u, -1, v));
			cnt[state]++;
		}
	}
	for (int j = 0; j < n; j++) {
		for (int i = 0; i < 1 << (n - 1); i++) {
			if (i >> j & 1) {
				cnt[i] += cnt[i - (1 << j)];
			}
		}
	}
	reverse(cnt.begin(), cnt.end());
	vector<int> dp(1 << (n - 1));
	vector<int> sum(1 << (n - 1));
	dp[0] = 1, sum[0] = 0;
	const int P = 1e9 + 7;
	vector<vector<int>> prod(m + 2, vector<int>(m + 1, 1));
	for (int i = 0; i <= m; i++) {
		for (int j = 0; j <= m; j++) {
			prod[i][j] = j == 0 ? 1 : prod[i][j - 1] * 1LL * (i + j - 1) % P;
		}
	}
	auto add = [&](int &x, int y) {
		x = (x + y) % P;
	};
	for (int i = 0; i < 1 << (n - 1); i++) {
		for (int j = 0; j < n - 1; j++) {
			if (i >> j & 1) {
				continue;
			}
			int prev = m - n + 1 - cnt[i] + __builtin_popcount(i);
			int added = cnt[i] - cnt[i | (1 << j)];
			add(dp[i | (1 << j)], dp[i] * 1LL * prod[prev + 1][added] % P);
			add(sum[i | (1 << j)], (sum[i] * 1LL * prod[prev + 2][added] + dp[i] * 1LL * prod[prev + 1][added] % P * (__builtin_popcount(i) + 1)) % P);
		}
	}
	cout << sum[(1 << (n - 1)) - 1] << endl;
	return 0;
}