//#pragma GCC optimize("Ofast,unroll-loops,fast-math,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt")
//#pragma GCC target("avx,avx2")
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<unordered_set>
#include<unordered_map>
#include<algorithm>
#include<iostream>
#include<string.h>
#include<iomanip>
#include<cstring>
#include<fstream>
#include<cassert>
#include<vector>
#include<string>
#include<memory>
#include<chrono>
#include<random>
#include<cmath>
#include<ctime>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
//no more #define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rforn(i, n) for (int i = n - 1; i >= 0; i--)
#define cmn(a, b) (a) = min((a), (b))
#define cmx(a, b) (a) = max((a), (b))
#define fastio ios::sync_with_stdio(false), cin.tie(0)
typedef long long ll;
typedef long double ld;
bool newLine = false;
bool newLineA = false;
bool pairEndLine = false;
template<class T>
istream& operator >> (istream& in, vector<T>& v) {
	for (auto& i : v) {
		in >> i;
	}
	return in;
}
template<class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	for (auto i : v) {
		out << i;
		if (!newLine) {
			out << ' ';
		}
		else {
			out << '\n';
		}
	}
	if (!newLine && newLineA) {
		out << '\n';
	}
	return out;
}
template<class T, class U>
istream& operator >> (istream& in, pair<T, U>& p) {
	in >> p.first >> p.second;
	return in;
}
template<class T, class U>
ostream& operator<<(ostream& out, const pair<T, U>& p) {
	out << p.first << ' ' << p.second;
	if (pairEndLine) {
		cout << '\n';
	}
	return out;
}
long long gettime() {
	return chrono::high_resolution_clock::now().time_since_epoch().count() / (long long)1000000;
}
//#define TRUE_RANDOM
#ifdef TRUE_RANDOM
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rnd_64(chrono::high_resolution_clock::now().time_since_epoch().count());
#else
mt19937 rnd(123);
mt19937_64 rnd_64(123);
#endif
unsigned long long randnum(unsigned long long l, unsigned long long r) {
	return l + rnd_64() % (r - l + 1);
}

const int mod = 998244353;

int add(int a, int b) {
	int res = a + b;
	if (res >= mod) res -= mod;
	return res;
}

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

const int N = 5010;

vector<int> g[N];
int k;
int dp[N][N];

int dfs(int v, int p = -1) {
	int h = 0;

	dp[v][0] = 1;

	for (auto u : g[v]) {
		if (u == p) continue;
		int curh = dfs(u, v);
		int oldh = h;
		cmx(h, curh + 1);

		int sum = 0;
		forn(i, curh + 1) {
			sum = add(sum, dp[u][i]);
		}

		vector<int> temp(h + 1, 0);

		forn(i, h + 1) {
			temp[i] = mult(dp[v][i], sum);
		}

		forn(i, oldh + 1) {
			forn(j, curh + 1) {
				if (i + j + 1 > k) continue;
				temp[max(i, j + 1)] = add(temp[max(i, j + 1)], mult(dp[v][i], dp[u][j]));
			}
		}

		forn(i, h + 1) {
			dp[v][i] = temp[i];
		}
	}

	return h;
}

signed main() {
	fastio;
	int n;
	cin >> n >> k;
	forn(i, n - 1) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	dfs(0);

	int ans = 0;
	forn(i, k + 1) ans = add(ans, dp[0][i]);

	cout << ans << '\n';

	return 0;
}