#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long q = 0, w = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    q = q * 10 + (ch - '0');
    ch = getchar();
  }
  return q * w;
}
const long long N = 1e5 + 95;
const long long M = 10 + 5;
const long long mod = 1e9 + 7;
long long n, m, k, many;
vector<long long> e[N];
long long dp[N][M][4];
long long f[M][4], cnt;
void add(int u, int v) {
  e[u].push_back(v);
  return;
}
void Clean(int x) {
  dp[x][0][0] = (k - 1);
  dp[x][1][1] = 1;
  dp[x][0][2] = (m - k);
  return;
}
void Clone(int x) {
  for (int k = 0; k <= many; k++) dp[x][k][0] = (f[k][0] % mod);
  for (int k = 0; k <= many; k++) dp[x][k][1] = (f[k][1] % mod);
  for (int k = 0; k <= many; k++) dp[x][k][2] = (f[k][2] % mod);
  return;
}
void DFS(int now, int dad) {
  Clean(now);
  int len = e[now].size();
  for (int i = 0; i < len; i++) {
    int x = e[now][i];
    if (x == dad) continue;
    DFS(x, now);
    memset(f, 0, sizeof(f));
    for (int j = 0; j <= many; j++)
      for (int k = 0; k <= (many - j); k++)
        f[j + k][0] =
            (f[j + k][0] +
             (dp[now][j][0] * (dp[x][k][0] + dp[x][k][1] + dp[x][k][2]) % mod) %
                 mod) %
            mod;
    for (int j = 0; j <= many; j++)
      for (int k = 0; k <= (many - j); k++)
        f[j + k][2] =
            (f[j + k][2] +
             (dp[now][j][2] * (dp[x][k][0] + dp[x][k][2]) % mod) % mod) %
            mod;
    for (int j = 0; j <= many; j++)
      for (int k = 0; k <= (many - j); k++)
        f[j + k][1] = (f[j + k][1] + (dp[now][j][1] * dp[x][k][0]) % mod) % mod;
    Clone(now);
  }
  return;
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= (n - 1); i++) {
    int u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  k = read();
  many = read();
  DFS(1, 0);
  for (int i = 0; i <= many; i++)
    cnt = (cnt + (dp[1][i][0] + dp[1][i][1] + dp[1][i][2]) % mod) % mod;
  cout << cnt << '\n';
  return 0;
}
