#include<bits/stdc++.h>
#define ll long long
#define mo 1000000007
#define N 22
using namespace std;
template <typename T> void read(T &x){
	x=0;char c=getchar();int fh=1;
	while (!isdigit(c)){if (c=='-')fh=-1;c=getchar();}
	while (isdigit(c))x=x*10+c-'0',c=getchar();
	x*=fh;
}
struct Info{ll an,ki;}dp[1000010];
ll jie[N*N],nj[N*N];
int m,n,x,y,p,no[N],f[N],d[N],g[1000010];
vector<pair<int,int> > a[N];
void dfs(int x,int fa,int dep){
	f[x]=fa;d[x]=dep;
	for (unsigned i=0;i<a[x].size();i++){
		if (a[x][i].first!=fa){
			no[a[x][i].first]=a[x][i].second;
			dfs(a[x][i].first,x,dep+1);
		}
	}
}
int co(int x){int an=0;while (x){an+=x&1;x/=2;}return an;}
ll po(ll x,ll y){ll z=1;while (y){if (y%2)z=x*z%mo;x=x*x%mo;y/=2;}return z;}
int main(){
	read(n);read(m);p=n-1;
	jie[0]=1;for (int i=1;i<=m;i++)jie[i]=jie[i-1]*i%mo;
	nj[m]=po(jie[m],mo-2);for (int i=m-1;i>=0;i--)nj[i]=nj[i+1]*(i+1)%mo;
	for (int i=1;i<n;i++){
		read(x);read(y);
		a[x].push_back(make_pair(y,1<<(i-1)));
		a[y].push_back(make_pair(x,1<<(i-1)));
	}
	dfs(1,0,1);
	for (int i=n;i<=m;i++){
		read(x);read(y);
		int an=0;
		while (x!=y){
			if (d[x]<d[y]) swap(x,y);
			an+=no[x];
			x=f[x];
		}
		g[an]++;
	}
	for (int i=0;i<p;i++)
		for (int j=0;j<(1<<p);j++)
			if (j&(1<<i))g[j]+=g[j-(1<<i)];
	dp[0].ki=1;dp[0].an=0;
	for (int i=0;i<(1<<p);i++){
		int cs=co(i);
		int no=(g[(1<<p)-1]-g[(1<<p)-1-i])+cs;
		for (int j=0;j<p;j++){
			if ((i&(1<<j))==0){
				int nu=g[(1<<p)-i-1]-g[(1<<p)-1-i-(1<<j)];
				dp[i+(1<<j)].ki=(dp[i+(1<<j)].ki+(dp[i].ki*jie[no+nu]%mo)*nj[no])%mo;
				dp[i+(1<<j)].an=(dp[i+(1<<j)].an+(dp[i].an*jie[no+nu+1]%mo)*nj[no+1]+((dp[i].ki*(cs+1)%mo)*jie[no+nu]%mo)*nj[no])%mo;
			}
		}
	}
	cout<<dp[(1<<p)-1].an<<endl;
	return 0;
}