#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 18) + 7, P = 998244353, inv2 = (P + 1) / 2;
int upd(int x) { return x + (x >> 31 & P); }
int n, K, sum1, sum2, f[N], g[N], sz[N], ans, fac[N], ifac[N];
vector<pair<vector<int>, vector<int> > > pol;
vector<int> nxt[N];
int binom(int x, int y) {
  if (x < y || y < 0) return 0;
  return 1ll * fac[x] * ifac[y] % P * ifac[x - y] % P;
}
int qpow(int x, int y) {
  int tms = 1;
  while (y) {
    if (y & 1) tms = 1ll * tms * x % P;
    x = 1ll * x * x % P, y >>= 1;
  }
  return tms;
}
int w[N], L, invL;
void Init(int len) {
  for (L = 1; L < len; L <<= 1)
    ;
  invL = qpow(L, P - 2);
  w[0] = 1, w[1] = qpow(3, (P - 1) / L);
  for (int i = 2; i < L; ++i) w[i] = 1ll * w[i - 1] * w[1] % P;
}
void DFT(int *p) {
  for (int i = L / 2, t = 1; i; i >>= 1, t <<= 1)
    for (int j = 0; j < L; j += (i << 1))
      for (int k = 0, o = 0; k < i; ++k, o += t) {
        int x = p[j + k], y = p[i + j + k];
        p[j + k] = upd(x + y - P), p[i + j + k] = 1ll * w[o] * upd(x - y) % P;
      }
}
void IDFT(int *p) {
  for (int i = 1, t = L / 2; i < L; i <<= 1, t >>= 1)
    for (int j = 0; j < L; j += (i << 1))
      for (int k = 0, o = 0; k < i; ++k, o += t) {
        int x = p[j + k], y = 1ll * w[o] * p[i + j + k] % P;
        p[j + k] = upd(x + y - P), p[i + j + k] = upd(x - y);
      }
  reverse(p + 1, p + L);
  for (int i = 0; i < L; ++i) p[i] = 1ll * p[i] * invL % P;
}
pair<vector<int>, vector<int> > getpol(int l, int r) {
  if (l == r) return pol[l];
  int mid = (l + r) >> 1;
  pair<vector<int>, vector<int> > lft = getpol(l, mid),
                                  rht = getpol(mid + 1, r);
  Init(lft.second.size() + rht.second.size());
  lft.first.resize(L), lft.second.resize(L);
  DFT(&lft.first[0]), DFT(&lft.second[0]);
  rht.first.resize(L), rht.second.resize(L);
  DFT(&rht.first[0]), DFT(&rht.second[0]);
  for (int i = 0; i < L; ++i) {
    lft.first[i] = (1ll * lft.first[i] * rht.second[i] % P +
                    1ll * lft.second[i] * rht.first[i] % P) %
                   P;
    lft.second[i] = 1ll * lft.second[i] * rht.second[i] % P;
  }
  IDFT(&lft.first[0]), IDFT(&lft.second[0]);
  while (lft.first.size() > 1 && !lft.first.back()) lft.first.pop_back();
  while (lft.second.size() > 1 && !lft.second.back()) lft.second.pop_back();
  return lft;
}
void dfs(int u, int lst) {
  sz[u] = 1;
  for (auto v : nxt[u])
    if (v != lst) dfs(v, u), sz[u] += sz[v], g[u] = upd(g[u] + g[v] - P);
  pol.clear();
  for (auto v : nxt[u])
    if (v != lst)
      pol.push_back(pair<vector<int>, vector<int> >({g[v]}, {1, sz[v]}));
  pol.push_back(pair<vector<int>, vector<int> >({0}, {1, n - sz[u]}));
  pair<vector<int>, vector<int> > now = getpol(0, pol.size() - 1);
  for (int i = 0; i < now.first.size(); ++i)
    ans = upd(ans + 1ll * binom(K, i) * fac[i] % P * now.first[i] % P - P);
  int inv = qpow(n - sz[u], P - 2);
  for (int i = (int)now.second.size() - 1; i; --i)
    now.second[i] = 1ll * now.second[i] * inv % P,
    now.second[i - 1] = upd(now.second[i - 1] - now.second[i]);
  for (int i = 0; i + 1 < now.second.size(); ++i)
    now.second[i] = now.second[i + 1],
    f[u] = upd(f[u] + 1ll * binom(K, i) * fac[i] % P * now.second[i] % P - P);
  ans = upd(ans - 1ll * f[u] * g[u] % P);
  g[u] = upd(g[u] + f[u] - P);
  sum1 = upd(sum1 + f[u] - P), sum2 = upd(sum2 + 1ll * f[u] * f[u] % P - P);
}
int main() {
  fac[0] = 1;
  for (int i = 1; i <= 100000; ++i) fac[i] = 1ll * fac[i - 1] * i % P;
  ifac[100000] = qpow(fac[100000], P - 2);
  for (int i = 100000 - 1; ~i; --i) ifac[i] = 1ll * ifac[i + 1] * (i + 1) % P;
  cin >> n >> K;
  for (int i = 1; i < n; ++i) {
    int p, q;
    cin >> p >> q;
    nxt[p].push_back(q), nxt[q].push_back(p);
  }
  if (K == 1) cout << 1ll * inv2 * n % P * (n - 1) % P, exit(0);
  dfs(1, 0);
  ans = upd(ans + 1ll * inv2 * upd(1ll * sum1 * sum1 % P - sum2) % P - P);
  cout << ans << endl;
  return 0;
}
