#include <bits/stdc++.h>

using namespace std;

const int N = (int)5e3 + 7;
const int mod = (int)998244353;

int add(int a, int b) {
  return (a + b) % mod;
}

int mul(int a, int b) {
  return (a * 1ll * b) % mod;
}

int n, k;
int sz[N];
vector <int> gr[N];
vector <int> dp[N];

void dfs(int v, int pr = -1) {
  sz[v] = 1;
  vector <int> nw, old;
  nw.resize(n + 1);
  old.resize(n + 1);
  old[0] = 1;
  for (int to : gr[v]) {
    if (to == pr) continue;
    dfs(to, v);
    fill(nw.begin(), nw.begin() + sz[v] + sz[to] + 1, 0);
    for (int i = 0; i <= sz[v]; i++) {
      for (int j = 0; j <= sz[to]; j++) {
        if (i + j + 1 <= k)
          nw[max(i, j + 1)] = add(nw[max(i, j + 1)], mul(old[i], dp[to][j]));
        if (max(i, j) <= k) 
          nw[i] = add(nw[i], mul(old[i], dp[to][j]));
      }
    }
    swap(old, nw);
    sz[v] += sz[to];
  }
  dp[v] = old;
}

int main() {
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  dfs(1);
  int ans = 0;
  for (int i = 0; i <= k; i++) {
    ans = add(ans, dp[1][i]);
  }
  cout << ans << endl;
}
