#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long N = 110;
const int mod = 1e9 + 7;
long long read() {
  long long MisakaMkikotoIsMyWife;
  scanf("%lld", &MisakaMkikotoIsMyWife);
  return MisakaMkikotoIsMyWife;
}
vector<int> G[N];
long long n, k, f[N][50];
void dfs(int u, int fa) {
  int siz = G[u].size();
  f[u][0] = 1;
  f[u][k + 1] = 1;
  long long tmp[N];
  for (int v, i = 0; i < siz; i++) {
    if ((v = G[u][i]) == fa) continue;
    dfs(v, u);
    for (int i = 0; i <= k * 2; i++) tmp[i] = 0;
    for (int i = 0; i <= k * 2; i++)
      for (int j = 0; j <= k * 2; j++) {
        if (i + j <= 2 * k)
          tmp[min(i, j + 1)] =
              (tmp[min(i, j + 1)] + f[u][i] * f[v][j] % mod) % mod;
        else
          tmp[max(i, j + 1)] =
              (tmp[max(i, j + 1)] + f[u][i] * f[v][j] % mod) % mod;
      }
    for (int i = 0; i <= 2 * k; i++) f[u][i] = tmp[i] % mod;
  }
}
int main() {
  n = read();
  k = read();
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  long long ans = 0;
  for (int i = 0; i <= k; i++) ans = (ans + f[1][i]) % mod;
  cout << ans;
}
