#include <bits/stdc++.h>
#define int long long int
#define all(x) x.begin(), x.end()
#define send ios_base::sync_with_stdio(false);
#define help cin.tie(NULL)
#define inf (int)(1e17+1)
#define mod (int)(998244353)
#define N (int)(5e3+5)
#define fi first
#define se second
#define endl "\n"
#define double long double
#define eps (double)(1e-9)
#define sa cout<<"sa"<<endl
using namespace std;

int k;
vector <int> adj[N];
vector <vector<int>> dp(N,vector <int>(N));

int dfs(int c,int pre){
	dp[c][0]=1;
	int mx=0;
	for(auto x:adj[c]){
		if(x==pre) continue;
		int a=dfs(x,c);
		vector <int> ndp(max(mx,a+1)+1);
		for(int i=0;i<=mx;i++){
			for(int j=0;j<=a;j++){
				if(j+1+i<=k) ndp[max(j+1,i)]+=dp[c][i]*dp[x][j]%mod; 
				if(i<=k&&j<=k) ndp[i]+=dp[c][i]*dp[x][j]%mod;
				ndp[max(j+1,i)]%=mod;ndp[i]%=mod;
			}
		}
		mx=max(mx,a+1);
		for(int i=0;i<=mx;i++) dp[c][i]=ndp[i];
	}
	return mx;
}

void solve(){
	int n;
	cin>>n>>k;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	dfs(1,0);
	int ans=0;
	for(int i=0;i<=k;i++) ans=(ans+dp[1][i])%mod;
	cout<<ans;
}
 
int32_t main(){ 
    send help;
    #ifdef LOCAL
  	freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);
	#endif
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}