#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 18;
const int lbt = 998244353;
vector<int> adj[maxn];
int prt[maxn], l[maxn], r[maxn], mch[maxn];
int ch[maxn];
int cnt[maxn];
int n;
vector<int> dp[maxn];
int rev(int a);
void dfs0(int u);
void dfs1(int u);
pair<vector<int>, vector<int>> solve(int l, int r);
int fast_pow(int a, int t);
void ntt(int *a, int k, int *ans, bool rev);
void add(vector<int> &a, vector<int> &b, vector<int> &c);
void juanji(vector<int> &a, vector<int> &b, vector<int> &c);
int main() {
  long long x;
  scanf("%d%lld", &n, &x);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs0(1);
  dfs1(1);
  int ans = 0;
  int cur = 1;
  for (int i = 1; i <= n; i++) {
    ans = (ans + (long long)cur * dp[1][i]) % lbt;
    cur = (long long)cur * ((x + i) % lbt) % lbt * rev(i) % lbt;
  }
  printf("%d", ans);
  return 0;
}
void dfs0(int u) {
  cnt[u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == prt[u]) continue;
    prt[v] = u;
    dfs0(v);
    if (ch[u])
      r[u] = v;
    else
      l[u] = v;
    ch[u]++;
    cnt[u] += cnt[v];
  }
  if (ch[u] == 1) mch[u] = l[u];
  if (ch[u] == 2) {
    if (cnt[l[u]] >= cnt[r[u]])
      mch[u] = l[u];
    else
      mch[u] = r[u];
  }
}
vector<int> b[maxn];
void dfs1(int u) {
  int cur = u;
  while (mch[cur]) {
    if (ch[cur] == 2) {
      if (l[cur] != mch[cur])
        dfs1(l[cur]);
      else
        dfs1(r[cur]);
    }
    cur = mch[cur];
  }
  cur = u;
  int len = 0;
  while (cur) {
    len++;
    b[len].clear();
    if (ch[cur] == 2) {
      if (l[cur] != mch[cur])
        b[len] = dp[l[cur]];
      else
        b[len] = dp[r[cur]];
    } else
      b[len].push_back(1);
    b[len].push_back(0);
    for (int i = b[len].size() - 1; i > 0; i--) {
      b[len][i] = b[len][i - 1];
    }
    b[len][0] = 0;
    cur = mch[cur];
  }
  dp[u] = solve(1, len).second;
  dp[u][0] = (dp[u][0] + 1) % lbt;
  cur = u;
  while (cur) {
    dp[l[cur]].clear();
    dp[r[cur]].clear();
    cur = mch[cur];
  }
  for (int i = 1; i <= len; i++) b[i].clear();
}
pair<vector<int>, vector<int>> solve(int l, int r) {
  if (l == r) return make_pair(b[l], b[l]);
  int sum = 0;
  for (int i = l; i <= r; i++) sum += b[i].size();
  int mid = l;
  int cur = b[l].size();
  while (2 * cur < sum) cur += b[++mid].size();
  if (mid == r) mid--;
  pair<vector<int>, vector<int>> ansl = solve(l, mid);
  pair<vector<int>, vector<int>> ansr = solve(mid + 1, r);
  vector<int> prod;
  juanji(ansl.first, ansr.first, prod);
  juanji(ansr.second, ansl.first, ansr.second);
  vector<int> ans;
  add(ansl.second, ansr.second, ans);
  return make_pair(prod, ans);
}
int fast_pow(int a, int t) {
  int ans = 1;
  for (int i = 31; i >= 0; i--) {
    ans = (long long)ans * ans % lbt;
    if (t >> i & 1) ans = (long long)a * ans % lbt;
  }
  return ans;
}
void ntt(int *a, int k, int *ans, bool rev) {
  static int bit_rev[maxn];
  static int rev3 = ::rev(3);
  int n = 1 << k;
  for (int i = 0; i < n; i++) {
    bit_rev[i] = (bit_rev[i >> 1] >> 1) | ((i & 1) << k - 1);
  }
  for (int i = 0; i < n; i++) {
    ans[bit_rev[i]] = a[i];
  }
  for (int t = 1; t <= k; t++) {
    int w_n = fast_pow(rev ? rev3 : 3, (lbt - 1) / (1 << t));
    for (int i = 0; i < n; i += (1 << t)) {
      int w = 1;
      for (int j = i; j < i + (1 << t - 1); j++) {
        int ans0 = ans[j];
        int ans1 = ans[j + (1 << t - 1)];
        ans[j] = (ans0 + (long long)w * ans1) % lbt;
        ans[j + (1 << t - 1)] = (ans0 + (long long)(lbt - w) * ans1) % lbt;
        w = (long long)w_n * w % lbt;
      }
    }
  }
  if (rev) {
    int rn = ::rev(n);
    for (int i = 0; i < n; i++) {
      ans[i] = (long long)rn * ans[i] % lbt;
    }
  }
}
void add(vector<int> &a, vector<int> &b, vector<int> &c) {
  c.clear();
  c.resize(max(a.size(), b.size()));
  for (int i = 0; i < a.size(); i++) {
    c[i] = a[i];
  }
  for (int i = 0; i < b.size(); i++) {
    c[i] = (c[i] + b[i]) % lbt;
  }
}
void juanji(vector<int> &a, vector<int> &b, vector<int> &c) {
  static int fa[maxn], fb[maxn];
  static int ta[maxn], tb[maxn];
  int k = 0;
  while ((1 << k) < a.size() + b.size() + 1) k++;
  for (int i = 0; i < a.size(); i++) ta[i] = a[i];
  for (int i = a.size(); i < (1 << k); i++) ta[i] = 0;
  for (int i = 0; i < b.size(); i++) tb[i] = b[i];
  for (int i = b.size(); i < (1 << k); i++) tb[i] = 0;
  ntt(ta, k, fa, 0);
  ntt(tb, k, fb, 0);
  for (int i = 0; i < (1 << k); i++) fa[i] = (long long)fa[i] * fb[i] % lbt;
  ntt(fa, k, fb, 1);
  int n = a.size() + b.size() - 1;
  c.clear();
  c.resize(n);
  for (int i = 0; i < n; i++) c[i] = fb[i];
}
int d, x, y;
void gcd(int a, int b) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
    return;
  }
  gcd(b, a % b);
  int t = x;
  x = y;
  y = t - a / b * y;
}
int rev(int a) {
  gcd(a, lbt);
  if (x < 0) x += lbt;
  return x;
}
