#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int mod = 1e9 + 7;
vector<int> edge[N];
long long dp[N][50];
long long tmp[50];
long long ans;
int n, k, u, v;
void dfs(int u, int fa) {
  dp[u][0] = dp[u][k + 1] = 1;
  for (int t = 0; t < edge[u].size(); t++) {
    int v = edge[u][t];
    if (v == fa) continue;
    dfs(v, u);
    memset(tmp, 0, sizeof(tmp));
    for (int i = 0; i <= 2 * k; i++) {
      for (int j = 0; j <= 2 * k; j++) {
        if (i + j <= 2 * k)
          (tmp[min(i, j + 1)] += dp[u][i] * dp[v][j]) %= mod;
        else {
          (tmp[max(i, j + 1)] += dp[u][i] * dp[v][j]) %= mod;
          if (max(i, j + 1) <= k) cout << "aaaa" << endl;
        }
      }
    }
    for (int i = 0; i <= 2 * k; i++) dp[u][i] = tmp[i];
  }
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs(1, 0);
  for (int i = 0; i <= k; i++) (ans += dp[1][i]) %= mod;
  cout << ans << endl;
}
