#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    a = a * 10 + c - 48;
    c = getchar();
  }
  return a;
}
const int P = 998244353, G = 3, _ = 1 << 18 | 1;
int upd(int x) { return x + (x >> 31 & P); }
int poww(long long a, int b) {
  int tms = 1;
  while (b) {
    if (b & 1) tms = tms * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return tms;
}
int dir[_], w[_], need, invnd;
void init(int l) {
  need = 1;
  while (need < l) need <<= 1;
  for (int i = 1; i <= need - 1; ++i)
    dir[i] = (dir[i >> 1]) >> 1 | (i & 1 ? need >> 1 : 0);
  static int L = 1;
  invnd = poww(need, P - 2);
  for (int &i = L; i < need; i <<= 1) {
    w[i] = 1;
    int wn = poww(G, P / i / 2);
    for (int j = 1; j < i; ++j) w[i + j] = 1ll * w[i + j - 1] * wn % P;
  }
}
void DFT(vector<int> &arr, int tp) {
  arr.resize(need);
  for (int i = 1; i <= need - 1; ++i)
    if (i < dir[i]) swap(arr[i], arr[dir[i]]);
  for (int i = 1; i < need; i <<= 1)
    for (int j = 0; j < need; j += i << 1)
      for (int k = 0; k <= i - 1; ++k) {
        int x = arr[j + k], y = 1ll * arr[i + j + k] * w[i + k] % P;
        arr[j + k] = upd(x + y - P);
        arr[i + j + k] = upd(x - y);
      }
  if (tp == -1) {
    reverse(arr.begin() + 1, arr.end());
    for (int i = 0; i <= need - 1; ++i) arr[i] = 1ll * arr[i] * invnd % P;
    while ((int)arr.size() && !arr.back()) arr.pop_back();
  }
}
vector<int> nxt[_];
long long X;
int N;
void addEd(int a, int b) { nxt[a].push_back(b); }
int son[_], top[_], sz[_], fa[_];
void dfs1(int x, int p) {
  fa[x] = p;
  sz[x] = 1;
  for (auto t : nxt[x])
    if (t != p) {
      dfs1(t, x);
      sz[x] += sz[t];
      son[x] = sz[son[x]] < sz[t] ? t : son[x];
    }
}
vector<int> pol[_];
pair<vector<int>, vector<int> > solve(vector<vector<int> > pot) {
  if ((int)pot.size() == 1) return make_pair(pot[0], pot[0]);
  int mid = (int)pot.size() >> 1;
  vector<vector<int> > L, R;
  for (int i = 0; i < (int)pot.size(); ++i) (i < mid ? L : R).push_back(pot[i]);
  pair<vector<int>, vector<int> > p = solve(L), q = solve(R);
  init((int)p.first.size() + (int)q.first.size());
  DFT(p.first, 1);
  DFT(p.second, 1);
  DFT(q.first, 1);
  for (int i = 0; i < need; ++i) {
    p.first[i] = 1ll * p.first[i] * q.first[i] % P;
    p.second[i] = 1ll * p.second[i] * q.first[i] % P;
  }
  DFT(p.first, -1);
  DFT(p.second, -1);
  for (int i = 0; i < (int)q.second.size(); ++i)
    p.second[i] = upd(p.second[i] + q.second[i] - P);
  return p;
}
void solve_chain(int x) {
  vector<vector<int> > cur;
  int t = x;
  while (x) {
    pol[x].insert(pol[x].begin(), 0);
    cur.push_back(pol[x]);
    x = son[x];
  }
  reverse(cur.begin(), cur.end());
  pol[t] = solve(cur).second;
  ++pol[t][0];
}
void dfs2(int x, int t) {
  pol[x] = {1};
  if (son[x]) {
    dfs2(son[x], t);
    for (auto t : nxt[x])
      if (t != fa[x] && t != son[x]) {
        dfs2(t, t);
        pol[x] = pol[t];
      }
  }
  if (x == t) solve_chain(x);
}
int main() {
  N = read();
  X = read() % P;
  for (int i = 1; i < N; ++i) {
    int x = read(), y = read();
    addEd(x, y);
    addEd(y, x);
  }
  dfs1(1, 0);
  dfs2(1, 1);
  int ans = 0;
  for (int i = 1, p = 1; i < (int)pol[1].size();
       p = 1ll * p * (X + i) % P * poww(i, P - 2) % P, ++i)
    ans = (ans + 1ll * p * pol[1][i]) % P;
  printf("%d\n", ans);
  return 0;
}
