#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 5005, MOD = 998244353;
vector<vector<ll>> dp(N, vector<ll>(N));
vector<vector<int>> edges(N);
vector<int> h(N);
int n, k;
void add(ll &x, ll y) {
	if((x += y) >= MOD) {
		x -= MOD;
	}
}
void dfs(int x, int p) {
	dp[x][0] = 1; 
	for(int to : edges[x]) {
		if(to != p) {
			dfs(to, x);
			vector<ll> temp(N);
			for(int L1 = 0; L1 <= min(h[x], k); ++L1) {
				for(int L2 = 0; L2 <= h[to]; ++L2) {
					ll ways = dp[x][L1] * dp[to][L2] % MOD;
					if(L1 + L2 < k) add(temp[max(L1, L2+1)], ways);
					add(temp[L1], ways);
				}
			}
			dp[x] = temp;
			h[x] = max(h[x], h[to]+1);
		}
	}
}
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n >> k;
	for(int i = 0; i < n - 1; ++i) {
		int u, v; cin >> u >> v;
		edges[u].push_back(v);
		edges[v].push_back(u);
	}
	dfs(1, 0);
	ll ans = 0;
	for(int i = 0; i <= k; ++i) {
		add(ans, dp[1][i]);
	}
	cout << ans << endl;
}
