#include <bits/stdc++.h>
using namespace std;

const int N = 5005, mod = 998244353;

int n, k, fa[N], f[N][N], len[N], t[N];
vector<int> g[N];

void dfs(int u) {
  f[u][0] = 1;
  for (auto v : g[u]) {
    if (v == fa[u]) continue;
    fa[v] = u, dfs(v);
    for (int i = 0; i <= max(len[u], len[v] + 1); i++) {
      t[i] = 0;
    }
    for (int i = 0; i <= len[u]; i++) {
      for (int j = 0; j <= len[v] && (i + j + 1) <= k; j++) {
        (t[max(i, j + 1)] += 1ll * f[u][i] * f[v][j] % mod) %= mod; 
      }
    }
    len[u] = max(len[u], len[v] + 1);
    int sum = 0;
    for (int i = 0; i <= len[v]; i++) {
      (sum += f[v][i]) %= mod;
    }
    for (int i = 0; i <= len[u]; i++) {
      f[u][i] = (1ll * f[u][i] * sum % mod + t[i]) % mod;
    }
  }
}

int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  int ans = 0;
  for (int i = 0; i <= len[1]; i++) {
    (ans += f[1][i]) %= mod;
  }
  printf("%d\n", ans);
  return 0;
}
