#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, M = (1 << 18) + 10, mod = 998244353;
long long rd() {
  long long x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * w;
}
int to[N << 1], nt[N << 1], hd[N], tot = 1;
void adde(int x, int y) {
  ++tot, to[tot] = y, nt[tot] = hd[x], hd[x] = tot;
  ++tot, to[tot] = x, nt[tot] = hd[y], hd[y] = tot;
}
void ad(int &x, int y) { x += y, x -= x >= mod ? mod : 0; }
int fpow(int a, int b) {
  int an = 1;
  while (b) {
    if (b & 1) an = 1ll * an * a % mod;
    a = 1ll * a * a % mod, b >>= 1;
  }
  return an;
}
int ginv(int a) { return fpow(a, mod - 2); }
int W[20], iW[20], rdr[M], pu[M], pv[M];
void ntt(int *a, int n, bool op) {
  int l = 0, y;
  while (1 << l < n) ++l;
  for (int i = 0; i < n; ++i) {
    rdr[i] = (rdr[i >> 1] >> 1) | ((i & 1) << (l - 1));
    if (i < rdr[i]) swap(a[i], a[rdr[i]]);
  }
  for (int i = 1, p = 0; i < n; i <<= 1, ++p) {
    int ww = op ? W[p] : iW[p];
    for (int j = 0; j < n; j += i << 1)
      for (int k = 0, w = 1; k < i; ++k, w = 1ll * w * ww % mod)
        y = 1ll * a[j + k + i] * w % mod,
        a[j + k + i] = (a[j + k] - y + mod) % mod,
        a[j + k] = (a[j + k] + y) % mod;
  }
  if (!op)
    for (int i = 0, w = ginv(n); i < n; ++i) a[i] = 1ll * a[i] * w % mod;
}
int n, k, ans, fac[N], iac[N], sz[N], f[N], sf[N];
vector<int> operator+(vector<int> a, vector<int> b) {
  vector<int> an;
  int nn = a.size(), mm = b.size(), ln = max(nn, mm);
  an.resize(ln);
  for (int i = 0; i < ln; ++i) {
    an[i] = 0;
    if (i < nn) ad(an[i], a[i]);
    if (i < mm) ad(an[i], b[i]);
  }
  return an;
}
vector<int> operator*(vector<int> a, vector<int> b) {
  vector<int> an;
  int nn = a.size(), mm = b.size(), len = 1;
  while (len <= nn + mm) len <<= 1;
  if (!nn || !mm) return an;
  an.resize(nn + mm - 1);
  if (1ll * nn * mm <= 1ll * (nn + mm) * 20) {
    for (int i = 0; i < nn; ++i)
      for (int j = 0; j < mm; ++j) ad(an[i + j], 1ll * a[i] * b[j] % mod);
  } else {
    for (int i = 0; i < nn; ++i) pu[i] = a[i];
    for (int i = 0; i < mm; ++i) pv[i] = b[i];
    ntt(pu, len, 1), ntt(pv, len, 1);
    for (int i = 0; i < len; ++i) pu[i] = 1ll * pu[i] * pv[i] % mod;
    ntt(pu, len, 0);
    for (int i = 0; i < nn + mm - 1; ++i) an[i] = pu[i];
    memset(pu, 0, sizeof(int) * len), memset(pv, 0, sizeof(int) * len);
  }
  return an;
}
vector<int> I, pa[N], nf, pb[N], ng;
vector<int> sov1(int l, int r) {
  if (l > r) return I;
  if (l == r) return pa[l];
  int mid = (l + r) >> 1;
  return sov1(l, mid) * sov1(mid + 1, r);
}
void sov2(int l, int r) {
  if (l >= r) return;
  int mid = (l + r) >> 1;
  sov2(l, mid), sov2(mid + 1, r);
  pb[l] = pb[l] * pa[mid + 1] + pb[mid + 1] * pa[l];
  pa[l] = pa[l] * pa[mid + 1];
}
int val(vector<int> a, int z) { return a[z]; }
int pt;
void dfs1(int x, int ffa) {
  sz[x] = 1;
  for (int i = hd[x]; i; i = nt[i]) {
    int y = to[i];
    if (y == ffa) continue;
    dfs1(y, x), sz[x] += sz[y];
    ad(sf[x], sf[y]);
  }
  pt = 0, pa[1].clear(), pb[1].clear();
  for (int i = hd[x]; i; i = nt[i]) {
    int y = to[i];
    if (y == ffa) continue;
    ++pt, pa[pt].clear(), pb[pt].clear();
    pa[pt].push_back(1), pa[pt].push_back(sz[y]), pb[pt].push_back(sf[y]);
  }
  nf = sov1(1, pt);
  int nn = nf.size();
  for (int i = 0; i < nn && i <= k; ++i)
    ad(f[x], 1ll * nf[i] * fac[k] % mod * iac[k - i] % mod);
  ad(sf[x], f[x]);
  sov2(1, pt);
  ng.clear(), ng.push_back(1), ng.push_back(n - sz[x]);
  ng = ng * pb[1];
  nn = ng.size();
  for (int i = 0; i < nn && i <= k; ++i)
    ad(ans, 1ll * ng[i] * fac[k] % mod * iac[k - i] % mod);
}
void dfs2(int x, int ffa, int sm) {
  ad(ans, 1ll * f[x] * (sm - sf[x] + mod) % mod);
  for (int i = hd[x]; i; i = nt[i]) {
    int y = to[i];
    if (y == ffa) continue;
    dfs2(y, x, (sm - f[x] + mod) % mod);
  }
}
int main() {
  for (int i = 1, p = 0; p < 19; i <<= 1, ++p)
    W[p] = fpow(3, (mod - 1) / (i << 1)), iW[p] = ginv(W[p]);
  fac[0] = 1;
  for (int i = 1; i <= N - 5; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  iac[N - 5] = ginv(fac[N - 5]);
  for (int i = N - 5; i; --i) iac[i - 1] = 1ll * iac[i] * i % mod;
  I.push_back(1);
  n = rd(), k = rd();
  for (int i = 1; i < n; ++i) adde(rd(), rd());
  if (k == 1) {
    printf("%d\n", (int)(1ll * n * (n - 1) / 2 % mod));
    return 0;
  }
  dfs1(1, 0);
  ans = 2ll * ans % mod;
  dfs2(1, 0, sf[1]);
  ans = 1ll * ans * ginv(2) % mod;
  printf("%d\n", ans);
  return 0;
}
