#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int N = 100005;
const int mod = 998244353, M = (1 << 19) + 1;
void add(int &a, int b) {
  a += b;
  (a >= mod) && (a -= mod);
}
void sub(int &a, int b) {
  a -= b;
  (a < 0) && (a += mod);
}
void mul(int &a, int b) { a = (long long)a * b % mod; }
int Add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
int Sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
int Mul(int a, int b) { return (long long)a * b % mod; }
int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (long long)ans * a % mod;
    a = (long long)a * a % mod;
    b >>= 1;
  }
  return ans;
}
namespace fft {
int I, rev[M];
vector<int> w[20];
void prepare(int n = 19) {
  for (int i = 1; i <= n; ++i) {
    w[i].resize(1 << i);
    w[i][0] = 1;
    w[i][1] = qpow(3, (mod - 1) >> i);
    for (int j = 2; j < (1 << i); ++j) w[i][j] = Mul(w[i][j - 1], w[i][1]);
  }
}
void init(int n) {
  I = qpow(n, mod - 2);
  for (int i = 0; i < n; ++i)
    rev[i] = (rev[i >> 1] >> 1) + ((i & 1) ? (n >> 1) : 0);
}
void dft(int *a, int n) {
  for (int i = 0; i < n; ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int mid = 1, now = 1; mid < n; mid <<= 1, ++now) {
    for (int i = 0; i < n; i += (mid << 1)) {
      int *W = &w[now][0];
      int *l = a + i, *r = a + i + mid;
      for (int j = 0; j < mid; ++j, ++W, ++l, ++r) {
        int tmp = Mul(*W, *r);
        *r = Sub(*l, tmp);
        add(*l, tmp);
      }
    }
  }
}
void idft(int *a, int n) {
  dft(a, n);
  reverse(a + 1, a + n);
  for (int i = 0; i < n; ++i) mul(a[i], I);
}
}  // namespace fft
using fft::dft;
using fft::idft;
vector<int> fix(vector<int> a, int n) {
  a.resize(n);
  return a;
}
vector<int> operator<<(vector<int> a, int n) {
  a.resize((int)a.size() + n);
  for (int i = (int)a.size() - 1; i >= 0; --i) a[i + n] = a[i];
  for (int i = 0; i < n; ++i) a[i] = 0;
}
vector<int> operator+(vector<int> a, vector<int> b) {
  a.resize(_max((int)a.size(), (int)b.size()));
  for (int i = 0; i < (int)b.size(); ++i) add(a[i], b[i]);
  return a;
}
vector<int> operator-(vector<int> a, vector<int> b) {
  a.resize(_max((int)a.size(), (int)b.size()));
  for (int i = 0; i < (int)b.size(); ++i) sub(a[i], b[i]);
  return a;
}
vector<int> operator*(vector<int> a, vector<int> b) {
  if (a.empty() || b.empty()) return vector<int>();
  int rn = (int)a.size() + (int)b.size() - 1;
  int n = 1 << (int)(log(rn) / log(2) + 1);
  a.resize(n);
  b.resize(n);
  fft::init(n);
  dft(&a[0], n);
  dft(&b[0], n);
  for (int i = 0; i < n; ++i) mul(a[i], b[i]);
  idft(&a[0], n);
  return fix(a, rn);
}
int n, fac[N], ifac[N];
long long A;
vector<int> G[N];
int fa[N], siz[N], son[N], top[N];
vector<int> p[N], a[N];
void prepare(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = Mul(fac[i - 1], i);
  ifac[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) ifac[i] = Mul(ifac[i + 1], i + 1);
}
void add_edge(int x, int y) { G[x].push_back(y); }
void dfs(int x, int f) {
  siz[x] = 1;
  son[x] = 0;
  fa[x] = f;
  for (int i = 0; i < (int)G[x].size(); ++i) {
    int to = G[x][i];
    if (to == f) continue;
    dfs(to, x);
    siz[x] += siz[to];
    if (siz[to] > siz[son[x]]) son[x] = to;
  }
}
void divi(int l, int r, vector<int> &f, vector<int> &g) {
  if (l == r) {
    f = a[l];
    g = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  vector<int> fl, fr, gl, gr;
  divi(l, mid, fl, gl);
  divi(mid + 1, r, fr, gr);
  f = fl * fr;
  g = gl + fl * gr;
}
vector<int> run(int now) {
  for (int x = now; x; x = son[x]) {
    p[x].clear();
    int flag = 0;
    for (int i = 0; i < (int)G[x].size(); ++i) {
      int to = G[x][i];
      if (to == fa[x] || to == son[x]) continue;
      flag = 1;
      p[x] = run(to);
      p[x].insert(p[x].begin(), 0);
      add(p[x][1], 1);
    }
    if (!flag) p[x].push_back(0), p[x].push_back(1);
  }
  int num = 0;
  for (int x = now; x; x = son[x]) {
    a[++num].swap(p[x]);
  }
  vector<int> f, g;
  divi(1, num, f, g);
  return g;
}
void init() {
  fft::prepare();
  read(n);
  read(A);
  prepare(n);
  for (int i = 1, u, v; i < n; ++i) {
    read(u);
    read(v);
    add_edge(u, v);
    add_edge(v, u);
  }
  dfs(1, 0);
}
void solve() {
  vector<int> f = run(1);
  int val = 1, X = A % mod, ans = 0;
  for (int i = 1; i < (int)f.size(); ++i) {
    int coef = Mul(val, ifac[i - 1]);
    add(ans, Mul(coef, f[i]));
    mul(val, Add(X, i));
  }
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
