#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int mod = 998244353;
int n, k, siz[maxn], rev[maxn << 2];
long long f[maxn], sf[maxn], fac[maxn], inv_fac[maxn], G[40][2], sx, sy, ans;
vector<int> g[maxn];
vector<long long> p[maxn << 2], q[maxn << 2];
inline long long fpow(long long a, long long b) {
  long long ret = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) ret = ret * a % mod;
  return ret;
}
inline void Gpre() {
  for (int l = 1, len = 1; len <= mod; l++, len <<= 1)
    G[l][0] = fpow(3, (mod - 1) / (len << 1)), G[l][1] = fpow(G[l][0], mod - 2);
}
inline void NTT(long long *f, int n, int op) {
  register int len, l, R, i, j;
  register long long buf, tmp, x, y, inv;
  for (i = 0; i < n; i++)
    if (i < rev[i]) swap(f[i], f[rev[i]]);
  for (len = 1, l = 1; len < n; len <<= 1, l++) {
    tmp = G[l][(op == 1) ? 0 : 1];
    for (R = len << 1, i = 0; i < n; i += R) {
      buf = 1;
      for (j = 0; j < len; j++) {
        x = f[i + j], y = buf * f[i + j + len] % mod;
        f[i + j] = (x + y) % mod, f[i + j + len] = (x - y + mod) % mod;
        buf = buf * tmp % mod;
      }
    }
  }
  if (op == 1) return;
  inv = fpow(n, mod - 2);
  for (i = 0; i < n; i++) f[i] = f[i] * inv % mod;
}
void dfs1(int x, int ff) {
  siz[x] = 1;
  for (auto y : g[x])
    if (y != ff) dfs1(y, x), siz[x] += siz[y];
  vector<int>::iterator it;
  for (it = g[x].begin(); it != g[x].end(); it++)
    if (*it == ff) {
      g[x].erase(it);
      break;
    }
}
inline void mul(const vector<long long> &a, const vector<long long> &b,
                vector<long long> &c) {
  static long long A[maxn << 2], B[maxn << 2];
  int n = (int)a.size(), m = (int)b.size(), lim;
  for (lim = 1; lim < n + m - 1; lim <<= 1)
    ;
  for (int i = 0; i < lim; i++)
    A[i] = (i < n) ? a[i] : 0, B[i] = (i < m) ? b[i] : 0;
  for (int i = 0; i < lim; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) ? (lim >> 1) : 0);
  NTT(A, lim, 1), NTT(B, lim, 1);
  for (int i = 0; i < lim; i++) A[i] = A[i] * B[i] % mod;
  NTT(A, lim, -1);
  for (int i = 0; i < n + m - 1; i++) (c[i] += A[i]) %= mod;
}
void solve(int l, int r, int rt, int x) {
  if (l == r) {
    int y = g[x][l];
    p[rt].clear(), p[rt].resize(2);
    q[rt].clear(), q[rt].resize(2);
    p[rt][0] = 1, p[rt][1] = siz[y];
    q[rt][0] = (f[y] + sf[y]) % mod;
    q[rt][1] = (f[y] + sf[y]) * (n - siz[x]) % mod;
    return;
  }
  int mid = (l + r) >> 1, ls = rt << 1, rs = rt << 1 | 1;
  solve(l, mid, ls, x), solve(mid + 1, r, rs, x);
  p[rt].clear(), p[rt].resize(r - l + 2), mul(p[ls], p[rs], p[rt]);
  q[rt].clear(), q[rt].resize(r - l + 2), mul(p[ls], q[rs], q[rt]),
      mul(q[ls], p[rs], q[rt]);
}
void dfs2(int x) {
  for (auto y : g[x]) dfs2(y), (sf[x] += f[y] + sf[y]) %= mod;
  if (!g[x].empty()) {
    solve(0, (int)g[x].size() - 1, 1, x);
    for (int i = 0; i <= min(k, (int)p[1].size() - 1); i++)
      (f[x] += fac[k] * inv_fac[k - i] % mod * p[1][i]) %= mod;
    for (int i = 0; i <= min(k, (int)q[1].size() - 1); i++)
      (ans += fac[k] * inv_fac[k - i] % mod * q[1][i]) %= mod;
  } else
    f[x] = 1;
  (sx += f[x]) %= mod, (sy += f[x] * f[x]) %= mod, (ans -= f[x] * sf[x]) %= mod;
}
int main() {
  Gpre();
  fac[0] = fac[1] = inv_fac[0] = inv_fac[1] = 1;
  for (int i = 2; i < maxn; i++) fac[i] = fac[i - 1] * i % mod;
  for (int i = 2; i < maxn; i++)
    inv_fac[i] = (mod - mod / i) * inv_fac[mod % i] % mod;
  for (int i = 2; i < maxn; i++) inv_fac[i] = inv_fac[i] * inv_fac[i - 1] % mod;
  scanf("%d%d", &n, &k);
  if (k == 1) return printf("%lld\n", (long long)n * (n - 1) / 2 % mod), 0;
  int x, y;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs1(1, 0), dfs2(1);
  printf("%lld\n",
         (((sx * sx - sy) % mod * ((mod + 1) >> 1) % mod + ans) % mod + mod) %
             mod);
  return 0;
}
