#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int N=5005;
int n,k;
vector<int>g[N];
int dp[N][N],tmp[N];
int dfs(int u,int fa){
        int h=0;
        dp[u][0]=1;
        for(auto v:g[u]){
                if(v==fa)continue;
                int hv=dfs(v,u);
                memset(tmp,0,sizeof(tmp));
                for(int i=0;i<=h;i++){
                        for(int j=0;j<=hv;j++){
                                if(i+j+1<=k){
                                        tmp[max(i,j+1)]=(tmp[max(i,j+1)]+1ll*dp[u][i]*dp[v][j])%mod;
                                }
                                if(i<=k&&j<=k){
                                        tmp[i]=(tmp[i]+1ll*dp[u][i]*dp[v][j])%mod;
                                }
                        }
                }
                for(int i=0;i<N;i++)dp[u][i]=tmp[i];
                h=max(h,hv+1);
        }
        return h;
}
int main(){
        cin>>n>>k;
        for(int i=1;i<n;i++){
                int u,v;
                cin>>u>>v;
                g[u].push_back(v);
                g[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<<endl;
        return 0;
}
