#include <bits/stdc++.h>
using namespace std;
long long pow_mod(long long x, int k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = ans * x % 998244353;
    x = x * x % 998244353;
    k >>= 1;
  }
  return ans;
}
long long facd[100005], facv[100005];
void pre(int n) {
  facd[0] = 1;
  for (int i = 1; i <= n; i++) facd[i] = facd[i - 1] * i % 998244353;
  facv[n] = pow_mod(facd[n], 998244353 - 2);
  for (int i = n - 1; i >= 0; i--) facv[i] = facv[i + 1] * (i + 1) % 998244353;
}
struct Edge {
  int t, next;
  Edge() {}
  Edge(int a, int b) : t(a), next(b) {}
};
Edge e[200005];
int head[100005];
namespace Poly {
void rev(long long *p, int len) {
  int j = len >> 1;
  for (int i = 1; i < len - 1; i++) {
    if (i < j) swap(p[i], p[j]);
    int k = len >> 1;
    while (j >= k) {
      j -= k;
      k >>= 1;
    }
    if (j < k) j += k;
  }
}
void ntt(long long *p, int len, int check) {
  rev(p, len);
  for (int i = 2; i <= len; i <<= 1) {
    long long wn = pow_mod(3, (998244353 - 1) / i);
    for (int j = 0; j < len; j += i) {
      long long w = 1;
      for (int k = j; k < j + (i >> 1); k++) {
        long long u = p[k];
        long long v = w * p[k + (i >> 1)] % 998244353;
        p[k] = (u + v) % 998244353;
        p[k + (i >> 1)] = (u - v + 998244353) % 998244353;
        w = w * wn % 998244353;
      }
    }
  }
  if (check == -1) {
    reverse(p + 1, p + len);
    long long nev = pow_mod(len, 998244353 - 2);
    for (int i = 0; i < len; i++) p[i] = p[i] * nev % 998244353;
  }
}
void mul(vector<int> &a, vector<int> &b, vector<int> &c) {
  static long long t1[1 << 18], t2[1 << 18];
  int len = 1;
  while (len < a.size() + b.size()) len <<= 1;
  for (int i = 0; i < a.size(); i++) t1[i] = a[i];
  for (int i = a.size(); i < len; i++) t1[i] = 0;
  for (int i = 0; i < b.size(); i++) t2[i] = b[i];
  for (int i = b.size(); i < len; i++) t2[i] = 0;
  ntt(t1, len, 1);
  ntt(t2, len, 1);
  for (int i = 0; i < len; i++) t1[i] = t1[i] * t2[i] % 998244353;
  ntt(t1, len, -1);
  c.resize(a.size() + b.size() - 1);
  for (int i = 0; i < c.size(); i++) c[i] = t1[i];
}
void add(vector<int> &a, vector<int> &b, vector<int> &c) {
  c.resize(max(a.size(), b.size()));
  for (int i = 0; i < c.size(); i++) {
    c[i] = 0;
    if (i < a.size()) c[i] = (c[i] + a[i]) % 998244353;
    if (i < b.size()) c[i] = (c[i] + b[i]) % 998244353;
  }
}
void right(vector<int> &a, vector<int> &b) {
  b.resize(a.size() + 1);
  for (int i = 1; i < a.size(); i++) b[i + 1] = a[i];
  b[0] = 0;
  b[1] = 1;
}
}  // namespace Poly
vector<int> f[100005], s1[400000], s2[400000];
vector<int> ans[100005];
void solve(int l, int r, int o) {
  static vector<int> t1;
  if (l == r)
    s1[o] = s2[o] = f[l];
  else {
    int m = ((l + r) >> 1);
    solve(l, m, o * 2);
    solve(m + 1, r, o * 2 + 1);
    Poly::mul(s1[o * 2], s1[o * 2 + 1], s1[o]);
    Poly::mul(s1[o * 2], s2[o * 2 + 1], t1);
    Poly::add(s2[o * 2], t1, s2[o]);
  }
}
namespace HLD {
int fa[100005], size[100005], son[100005];
void calc(int x) {
  int tot = 0;
  for (int i = x; i; i = son[i]) f[++tot] = ans[i];
  solve(1, tot, 1);
  ans[x] = s2[1];
}
void dfs1(int x) {
  size[x] = 1;
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].t != fa[x]) {
      int u = e[i].t;
      fa[u] = x;
      dfs1(u);
      size[x] += size[u];
      if (size[u] > size[son[x]]) son[x] = u;
    }
}
void dfs2(int x, int anc) {
  if (son[x]) dfs2(son[x], anc);
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].t != fa[x] && e[i].t != son[x]) {
      dfs2(e[i].t, e[i].t);
      Poly::right(ans[e[i].t], ans[x]);
    }
  if (!ans[x].size()) {
    ans[x].resize(2);
    ans[x][0] = 0;
    ans[x][1] = 1;
  }
  if (x == anc) calc(x);
}
}  // namespace HLD
long long C(vector<int> &a, long long fir, int n) {
  fir %= 998244353;
  long long s = 1, ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + s * facv[i - 1] % 998244353 * a[i]) % 998244353;
    s = s * (fir + i) % 998244353;
  }
  return ans;
}
int main() {
  int n;
  long long fir = 0;
  scanf("%d%lld", &n, &fir);
  pre(n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[2 * i - 1] = Edge(y, head[x]);
    head[x] = 2 * i - 1;
    e[2 * i] = Edge(x, head[y]);
    head[y] = 2 * i;
  }
  HLD::dfs1(1);
  HLD::dfs2(1, 1);
  long long sum = C(ans[1], fir, n);
  printf("%lld\n", sum);
  return 0;
}
