#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10, mo = 998244353;
int n;
long long s;
int final[N], nex[N], to[N], tot;
vector<int> f[N];
void link(int x, int y) { to[++tot] = y, nex[tot] = final[x], final[x] = tot; }
long long ksm(long long x, long long y) {
  x %= mo;
  long long ret = 1;
  for (; y; y >>= 1) {
    if (y & 1) ret = ret * x % mo;
    x = x * x % mo;
  }
  return ret;
}
int sz[N], hvy[N], fa[N];
void dfs(int x) {
  sz[x] = 1;
  for (int i = final[x]; i; i = nex[i]) {
    int y = to[i];
    if (y != fa[x]) {
      fa[y] = x;
      dfs(y);
      if (sz[y] > sz[hvy[x]]) hvy[x] = y;
      sz[x] += sz[y];
    }
  }
}
int cnt, L[N], R[N], g[N], cj[N];
int cc, lw[N], rw[N], gw[N];
int M, fulM;
long long W[N];
void DFT(int *a) {
  static int h[N * 2];
  for (int i = 0; i < M; i++) {
    h[i] = (h[i >> 1] >> 1) + (i & 1) * (M >> 1);
    if (i < h[i]) swap(a[i], a[h[i]]);
  }
  for (int m = 1; m < M; m <<= 1) {
    int step = fulM / (m << 1);
    for (int i = 0; i < M; i += (m << 1)) {
      for (int j = 0, d = 0; j < m; j++, d += step) {
        long long t = a[i + j + m] * W[d];
        a[i + j + m] = (a[i + j] - t) % mo;
        a[i + j] = (a[i + j] + t) % mo;
      }
    }
  }
}
void IDFT(int *a) {
  reverse(a + 1, a + M);
  DFT(a);
  long long ny = ksm(M, mo - 2);
  for (int i = 0; i < M; i++) a[i] = a[i] * ny % mo;
}
void mult(int *al, int *ar, int *bl, int *br, int *rl, int *rr) {
  static int A[N], B[N];
  int sza = ar - al + 1, szb = br - bl + 1, rsz = sza + szb - 1;
  for (M = 1; M <= rsz; M <<= 1)
    ;
  memset(A, 0, 4 * M);
  memset(B, 0, 4 * M);
  for (int *i = al, j = 0; i <= ar; i++, j++) A[j] = *i;
  for (int *i = bl, j = 0; i <= br; i++, j++) B[j] = *i;
  DFT(A);
  DFT(B);
  for (int i = 0; i < M; i++) A[i] = (long long)A[i] * B[i] % mo;
  IDFT(A);
  for (int *i = rl; i <= rr; i++) *i = 0;
  for (int i = 0; i < rsz; i++) *(rl + i) = A[i];
}
void divide2(int l, int r) {
  if (l == r) return;
  int mid = l + r >> 1;
  divide2(l, mid);
  divide2(mid + 1, r);
  int sz = rw[l] - lw[l] + 1 + rw[mid + 1] - lw[mid + 1] + 1;
  mult(gw + lw[l], gw + rw[l], gw + lw[mid + 1], gw + rw[mid + 1], gw + lw[l],
       gw + lw[l] + sz - 1);
  rw[l] = lw[l] + sz - 1;
  while (lw[l] < rw[l] && rw[l] == 0) rw[l]--;
}
void divide(int l, int r) {
  if (l == r) {
    for (int i = L[l]; i <= R[l]; i++) cj[i] = g[i];
    return;
  }
  int mid = l + r >> 1;
  divide(l, mid);
  divide(mid + 1, r);
  static int A[N];
  int sz = R[l] - L[l] + 1 + R[mid + 1] - L[mid + 1] + 1;
  mult(cj + L[l], cj + R[l], g + L[mid + 1], g + R[mid + 1], A,
       A + R[mid + 1] - L[l] + 1);
  for (int i = L[l], j = 0; i <= R[l]; i++, j++) {
    g[i] = (g[i] + A[j]) % mo;
  }
  int ls = 0;
  for (int i = R[l] + 1, cs = R[l] - L[l] + 1; cs <= R[mid + 1] - L[l] + 1;
       i++, cs++) {
    g[i] = A[cs];
    ls = i;
  }
  if (ls)
    for (int i = ls + 1; i <= R[mid + 1]; i++) g[i] = 0;
  mult(cj + L[l], cj + R[l], cj + L[mid + 1], cj + R[mid + 1], cj + L[l],
       cj + R[mid + 1]);
  R[l] = R[mid + 1];
}
void calc(int x) {
  f[x].resize(sz[x] + 1);
  int y = x;
  while (y) {
    for (int i = final[y]; i; i = nex[i]) {
      int z = to[i];
      if (z != hvy[y] && z != fa[y]) {
        calc(z);
      }
    }
    y = hvy[y];
  }
  cnt = 0, *g = 0;
  y = x;
  while (y) {
    cc = 0, *gw = 0;
    ++cnt;
    L[cnt] = ++*g;
    g[*g] = 0;
    for (int i = final[y]; i; i = nex[i]) {
      int z = to[i];
      if (z != fa[y] && z != hvy[y]) {
        ++cc;
        lw[cc] = 1 + *gw;
        for (int i = 0, e = f[z].size(); i < e; i++) {
          gw[++*gw] = f[z][i];
        }
        rw[cc] = *gw;
      }
    }
    if (cc) {
      divide2(1, cc);
      for (int i = lw[1], j = 0; i <= rw[1]; i++, j++) {
        g[++*g] = gw[i];
      }
    } else {
      g[++*g] = 1;
    }
    R[cnt] = *g;
    y = hvy[y];
  }
  if (cnt) {
    divide(1, cnt);
    for (int i = L[1], j = 0; i <= R[1] && j < f[x].size(); i++, j++) {
      f[x][j] = g[i];
    }
  } else
    f[x][1] = 1;
  f[x][0] = 1;
}
int main() {
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    link(x, y), link(y, x);
  }
  fulM = 131072 * 2;
  W[0] = 1;
  W[1] = ksm(3, (mo - 1) / fulM);
  for (int i = 2; i < fulM; i++) W[i] = W[i - 1] * W[1] % mo;
  dfs(1);
  calc(1);
  long long ans = 0;
  long long t = 1;
  for (int r = 1; r <= n; r++) {
    ans = (ans + f[1][r] * t) % mo;
    t = t * ((s % mo + r) % mo) % mo * ksm(r, mo - 2) % mo;
  }
  cout << (ans + mo) % mo << endl;
}
