#include <bits/stdc++.h>
const int N = 105, mo = 1e9 + 7;
struct E {
  int to;
  E* nxt;
} CD[N << 1], *cd = CD, *head[N];
inline void adde(int a, int b) {
  cd->to = b, cd->nxt = head[a], head[a] = cd++;
}
int dp[50][N], f[50];
int k;
inline void add(int& a, int b) { (a += b) >= mo ? a -= mo : 1; }
void dfs(int u, int fa) {
  dp[0][u] = dp[k + 1][u] = 1;
  int v;
  for (E* it = head[u]; it; it = it->nxt)
    if ((v = it->to) ^ fa) {
      dfs(v, u);
      memset(f, 0, sizeof f);
      for (int i = 0; i <= 2 * k; ++i)
        for (int j = 0; j <= 2 * k; ++j)
          if (i + j <= 2 * k)
            add(f[std::min(i, j + 1)], 1LL * dp[i][u] * dp[j][v] % mo);
          else
            add(f[std::max(i, j + 1)], 1LL * dp[i][u] * dp[j][v] % mo);
      for (int i = 0; i <= 2 * k + 1; ++i) dp[i][u] = f[i];
    }
}
int main() {
  int n, a, b, i;
  scanf("%d%d", &n, &k);
  for (i = 1; i < n; ++i) scanf("%d%d", &a, &b), adde(a, b), adde(b, a);
  dfs(1, 0);
  int ans = 0;
  for (i = 0; i <= k; ++i)
    for (ans += dp[i][1]; ans >= mo; ans -= mo)
      ;
  printf("%d\n", ans);
  return 0;
}
