#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int maxn = 4e5 + 100;
int ksm(int num, int t) {
  int res = 1;
  for (; t; t >>= 1, num = 1ll * num * num % mod) {
    if (t & 1) res = 1ll * res * num % mod;
  }
  return res;
}
struct NTT {
  int wn[2][maxn], tmp1[maxn], tmp2[maxn], rev[maxn];
  void get_wn(int cnt) {
    for (int l = 2; l <= (1 << cnt); l <<= 1) {
      int w1 = ksm(3, (mod - 1) / l), w0 = ksm(3, mod - 1 - (mod - 1) / l);
      wn[1][l >> 1] = wn[0][l >> 1] = 1;
      for (int j = 1; j < l >> 1; j++) {
        wn[1][(l >> 1) + j] = 1ll * wn[1][(l >> 1) + j - 1] * w1 % mod;
        wn[0][(l >> 1) + j] = 1ll * wn[0][(l >> 1) + j - 1] * w0 % mod;
      }
    }
  }
  NTT() {
    int top = maxn / 2;
    int cnt = 0, len = 1;
    while (len <= top) cnt++, len <<= 1;
    get_wn(cnt);
  }
  void ntt(int len, int *c, int f) {
    for (int i = 0; i < len; i++)
      if (rev[i] > i) swap(c[rev[i]], c[i]);
    for (int l = 2; l <= len; l <<= 1) {
      for (int i = 0; i + l <= len; i += l) {
        for (int j = i; j < i + (l >> 1); j++) {
          int tmpa = c[j],
              tmpb = 1ll * c[j + (l >> 1)] * wn[f][j - i + (l >> 1)] % mod;
          c[j] = (tmpa + tmpb) % mod;
          c[j + (l >> 1)] = (tmpa - tmpb) % mod;
          if (c[j + (l >> 1)] < 0) c[j + (l >> 1)] += mod;
        }
      }
    }
    if (!f) {
      int inv = ksm(len, mod - 2);
      for (int i = 0; i < len; i++) c[i] = 1ll * c[i] * inv % mod;
    }
  }
  void get_rev(int cnt) {
    for (int i = 1; i < (1 << cnt); i++)
      rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (cnt - 1));
  }
  vector<int> mul(const vector<int> &a, const vector<int> &b) {
    int l1 = a.size(), l2 = b.size();
    int cnt = 0, len = 1;
    while (len <= l1 + l2) len <<= 1, cnt++;
    get_rev(cnt);
    for (int i = 0; i < len; i++) tmp1[i] = tmp2[i] = 0;
    for (int i = 0; i < a.size(); i++) tmp1[i] = a[i];
    for (int i = 0; i < b.size(); i++) tmp2[i] = b[i];
    ntt(len, tmp1, 1);
    ntt(len, tmp2, 1);
    for (int i = 0; i < len; i++) tmp1[i] = 1ll * tmp1[i] * tmp2[i] % mod;
    ntt(len, tmp1, 0);
    vector<int> re;
    for (int i = 0; i < len; i++) re.push_back(tmp1[i]);
    re.resize(l1 + l2 - 1);
    return re;
  }
  vector<int> add(const vector<int> &a, const vector<int> &b) {
    vector<int> re;
    re.resize(max(a.size(), b.size()));
    for (int i = (0), iend = ((int)max(a.size(), b.size()) - 1); i <= iend;
         i++) {
      if (a.size() >= i + 1) re[i] = (re[i] + a[i]) % mod;
      if (b.size() >= i + 1) re[i] = (re[i] + b[i]) % mod;
    }
    return re;
  }
} t;
vector<int> side[maxn];
int frac[maxn], down_mi[maxn], bnom[maxn], mysize[maxn], heavy[maxn], top[maxn];
void dfs1(int u, int fa) {
  mysize[u] = 1;
  for (int i = 0; i < side[u].size(); i++) {
    int v = side[u][i];
    if (v == fa) continue;
    dfs1(v, u);
    mysize[u] += mysize[v];
    if (!heavy[u] || mysize[heavy[u]] < mysize[v]) heavy[u] = v;
  }
}
void dfs2(int u, int fa, int Top) {
  top[u] = Top;
  for (int i = 0; i < side[u].size(); i++) {
    int v = side[u][i];
    if (v == fa) continue;
    dfs2(v, u, (heavy[u] == v) ? Top : v);
  }
}
vector<int> f[maxn];
vector<int> base[maxn];
vector<int> merge(int l, int r) {
  if (l == r) return base[l];
  int mid = (l + r) >> 1;
  return t.mul(merge(l, mid), merge(mid + 1, r));
}
vector<int> G[maxn];
void dfs3(int u, int fa);
void dfs4(int u, int fa) {
  for (int i = 0; i < side[u].size(); i++) {
    int v = side[u][i];
    if (v == fa || v == heavy[u]) continue;
    dfs3(v, u);
  }
  int top = 0;
  for (int i = 0; i < side[u].size(); i++) {
    int v = side[u][i];
    if (v == fa || v == heavy[u]) continue;
    base[++top] = f[v];
    if (base[top].size() < 1) base[top].resize(1);
    base[top][0]++;
  }
  if (top) {
    G[u] = merge(1, top);
    vector<int> tmp;
    tmp.clear();
    tmp.resize(2);
    tmp[1] = 1;
    G[u] = t.mul(G[u], tmp);
  } else {
    G[u].clear();
    G[u].resize(2);
    G[u][1] = 1;
  }
  if (heavy[u]) dfs4(heavy[u], u);
}
vector<int> a[maxn];
int stk[maxn];
vector<int> Z[maxn * 4], W[maxn * 4];
void find_f(int l, int r, int rt) {
  if (l == r) {
    W[rt] = a[l];
    Z[rt] = a[l];
    Z[rt][0]++;
    return;
  }
  int mid = (l + r) >> 1;
  find_f(l, mid, rt << 1);
  find_f(mid + 1, r, rt << 1 | 1);
  W[rt] = t.mul(W[rt << 1], W[rt << 1 | 1]);
  Z[rt << 1][0]--;
  Z[rt] = t.add(t.mul(Z[rt << 1], W[rt << 1 | 1]), Z[rt << 1 | 1]);
  Z[rt << 1][0]++;
}
void dfs3(int u, int fa) {
  dfs4(u, fa);
  int top = 0, x = u;
  stk[++top] = x;
  while (heavy[x]) x = heavy[x], stk[++top] = x;
  a[1].resize(2);
  a[1][0] = 0, a[1][1] = 1;
  for (int i = top - 1; i >= 1; i--) {
    a[top - i + 1] = G[stk[i]];
  }
  find_f(1, top, 1);
  f[u] = Z[1];
  f[u][0]--;
}
int main() {
  frac[0] = 1;
  for (int i = (1), iend = (maxn - 1); i <= iend; i++)
    frac[i] = 1ll * frac[i - 1] * i % mod;
  int n;
  long long s;
  scanf("%d%lld", &n, &s);
  s %= mod;
  down_mi[1] = 1;
  for (int i = (2), iend = (maxn - 1); i <= iend; i++)
    down_mi[i] = 1ll * down_mi[i - 1] * (s + i - 1) % mod;
  for (int i = (1), iend = (maxn - 1); i <= iend; i++)
    bnom[i] = 1ll * down_mi[i] * ksm(frac[i - 1], mod - 2) % mod;
  for (int i = (1), iend = (n - 1); i <= iend; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    side[u].push_back(v);
    side[v].push_back(u);
  }
  dfs1(1, 0);
  dfs2(1, 0, 1);
  dfs3(1, 0);
  int ans = 0;
  for (int i = (1), iend = (n); i <= iend; i++) {
    ans = (ans + 1ll * f[1][i] * bnom[i]) % mod;
  }
  printf("%d", ans);
  return 0;
}
