#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 110;
long long f[N][2 * N], sum[N][2 * N];
int n, k;
vector<int> e[N];
void dfs(int v, int fa) {
  int cnt = 0;
  for (auto u : e[v]) {
    if (u == fa) continue;
    dfs(u, v);
    cnt++;
  }
  for (int i = 0; i < k; i++) {
    long long tmp1 = 1, tmp2 = 1;
    for (auto u : e[v]) {
      if (u == fa) continue;
      tmp1 =
          tmp1 * (sum[u][((i + 1) + k + 1)] - sum[u][((-i - 1) + k + 1)]) % MOD;
      tmp2 = tmp2 * (sum[u][((i) + k + 1)] - sum[u][((-i - 1) + k + 1)]) % MOD;
    }
    f[v][((i) + k + 1)] += (tmp1 - tmp2) % MOD;
  }
  for (int i = -k; i < 0; i++) {
    long long tmp1 = 1, tmp2 = 1;
    for (auto u : e[v]) {
      if (u == fa) continue;
      tmp1 = tmp1 * (sum[u][((-i - 1) + k + 1)] - sum[u][((i) + k + 1)]) % MOD;
      tmp2 =
          tmp2 * (sum[u][((-i - 1) + k + 1)] - sum[u][((i + 1) + k + 1)]) % MOD;
    }
    f[v][((i) + k + 1)] += (tmp1 - tmp2) % MOD;
  }
  long long tmp = 1;
  for (auto u : e[v]) {
    if (u == fa) continue;
    tmp = tmp * (sum[u][((k) + k + 1)] - sum[u][((-k - 1) + k + 1)]) % MOD;
  }
  f[v][((k) + k + 1)] += tmp;
  if (!cnt) f[v][((-1) + k + 1)] = 1;
  for (int i = -k; i <= k; i++)
    sum[v][((i) + k + 1)] = sum[v][((i - 1) + k + 1)] + f[v][((i) + k + 1)];
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1, 0);
  printf("%I64d\n",
         ((sum[1][((k) + k + 1)] - sum[1][((-1) + k + 1)]) % MOD + MOD) % MOD);
  return 0;
}
