#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int MOD = 998244353;
const int g = 3;
int qpow(int x, int y = MOD - 2) {
  int res = 1;
  for (; y; y >>= 1, x = (long long)x * x % MOD)
    if (y & 1) res = (long long)res * x % MOD;
  return res;
}
int n, K, jc[N], njc[N];
void Prework() {
  jc[0] = 1;
  for (int i = 1; i <= K; ++i) jc[i] = (long long)jc[i - 1] * i % MOD;
  njc[K] = qpow(jc[K]);
  for (int i = K - 1; ~i; --i) njc[i] = (long long)njc[i + 1] * (i + 1) % MOD;
}
int Ar(int n, int m) { return (long long)jc[n] * njc[n - m] % MOD; }
int sz[N], sm[N];
vector<int> G[N];
int U(int x, int y) { return ((x += y) >= MOD) ? (x - MOD) : x; }
void SU(int& x, int y) { ((x += y) >= MOD) ? (x -= MOD) : 0; }
int ans;
vector<int> t;
int w[N] = {1};
void FFT(vector<int>& A, bool fl) {
  int L = A.size();
  for (int i = 1, j = L >> 1, k; i < L; ++i, j ^= k) {
    if (i < j) swap(A[i], A[j]);
    k = L >> 1;
    while (j & k) {
      j ^= k;
      k >>= 1;
    }
  }
  for (int i = 1; i < L; i <<= 1) {
    int t = qpow(g, (MOD - 1) / (i << 1));
    if (fl) t = qpow(t);
    for (int j = 1; j < i; ++j) w[j] = (long long)w[j - 1] * t % MOD;
    vector<int>::iterator p = A.begin(), q = p + i;
    for (int j = 0; j < L; j += (i << 1), p += i, q += i) {
      for (int k = 0; k < i; ++k, ++p, ++q) {
        t = (long long)(*q) * w[k] % MOD;
        *q = U(*p, MOD - t);
        SU(*p, t);
      }
    }
  }
  if (fl) {
    int t = qpow(L);
    for (int i = 0; i < L; ++i) A[i] = (long long)A[i] * t % MOD;
  }
}
void Print(const vector<int> p) {
  for (int v : p) cout << v << " ";
  cout << endl;
}
void Fuck() { cout << "!!!!!!!!!!!!!!!!!!" << endl; }
void deFuck() { cout << "------------------" << endl; }
vector<int> operator*(vector<int> A, vector<int> B) {
  int len = A.size() + B.size() - 1, l;
  for (l = 1; l < len; l <<= 1)
    ;
  A.resize(l);
  FFT(A, false);
  B.resize(l);
  FFT(B, false);
  for (int i = 0; i < l; ++i) A[i] = (long long)A[i] * B[i] % MOD;
  FFT(A, true);
  A.resize(len);
  return A;
}
vector<int> DivCalc(int l, int r) {
  vector<int> res;
  if (l < r) {
    int mid = (l + r) >> 1;
    vector<int> A = DivCalc(l, mid), B = DivCalc(mid + 1, r);
    res = A * B;
  } else if (l == r) {
    res.emplace_back(1);
    res.emplace_back(t[l]);
  } else if (l > r)
    res.emplace_back(1);
  return res;
}
int Dark(vector<int> p, int x, int y) {
  for (int i = 1; i <= (int)p.size() - 1; ++i)
    SU(p[i], MOD - (long long)y * p[i - 1] % MOD);
  for (int i = p.size() - 1; i > 0; --i)
    SU(p[i], (long long)x * p[i - 1] % MOD);
  int res = 0;
  for (int i = 1; i < (int)p.size(); ++i)
    SU(res, (long long)p[i] * Ar(K, i) % MOD);
  return res;
}
int rec[N], vis[N], cc;
void Dfs(int u, int fa = 0) {
  sz[u] = sm[u] = 1;
  for (int v : G[u])
    if (v != fa) {
      Dfs(v, u);
      SU(ans, (long long)sm[u] * sm[v] % MOD);
      SU(sm[u], sm[v]);
      sz[u] += sz[v];
    }
  t.clear();
  for (int v : G[u])
    if (v != fa) t.emplace_back(sz[v]);
  static vector<int> p;
  p = DivCalc(0, t.size() - 1);
  if ((int)p.size() - 1 > K) p.resize(K + 1);
  for (int i = 1; i < (int)p.size(); ++i)
    SU(sm[u], (long long)Ar(K, i) * p[i] % MOD);
  ++cc;
  for (int v : G[u])
    if (v != fa) {
      if (vis[sz[v]] != cc) {
        rec[sz[v]] = Dark(p, n - sz[u], sz[v]);
        vis[sz[v]] = cc;
      }
      SU(ans, (long long)rec[sz[v]] * sm[v] % MOD);
    }
}
int main() {
  scanf("%d%d", &n, &K);
  if (K == 1) {
    printf("%lld\n", (long long)n * (n - 1) / 2 % MOD);
    return 0;
  }
  Prework();
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    G[u].emplace_back(v);
    G[v].emplace_back(u);
  }
  Dfs(1);
  printf("%d\n", ans);
  return 0;
}
