#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
int N, a, b, K, S;
int dx[(101)][(47)][(47)], D[(101)], dp[(101)][(101)][(47)][(47)][2], W[(101)];
vector<int> g[(101)];
int dxh(int u, int U, int B, int p);
int dyn(int u, int I, int U, int B, int p, bool x) {
  if (I == int(g[u].size())) return x;
  if (g[u][I] == p) return dyn(u, I + 1, U, B, p, x);
  int &v = dp[u][I][U][B][x];
  if (~v) return v;
  v = dyn(u, I + 1, U, B, p, 1) * 1ll * dxh(g[u][I], U, B, u) % (1000000007);
  if (D[g[u][I]] + B <= K || D[g[u][I]] + U + 2 <= K)
    v += dyn(u, I + 1, U, B, p, x), v %= (1000000007);
  for (int k(U + 1); k < K * 2 + 1; k++)
    if (k + B <= 2 * K + 1 || k + U + 1 <= 2 * K)
      v += dyn(u, I + 1, U, B, p, x) * 1ll * dxh(g[u][I], k, min(B, U + 2), u) %
           (1000000007),
          v %= (1000000007);
  return v;
}
int dxh(int u, int U, int B, int p) {
  int &v = dx[u][U][B], S;
  if (~v) return v;
  if (U > D[u]) return (v = 0);
  if (!U) {
    if (D[u] <= K && W[u] < 62) return (1ll << W[u]) % (1000000007);
    v = 1;
    for (auto &h : g[u])
      if (h ^ p) {
        S = 0;
        for (int i(0); i < 2 * K + 1; i++)
          S += dxh(h, i, 1, u), S %= (1000000007);
        if (D[h] < K) ++S, S %= (1000000007);
        v = (v * 1ll * S) % (1000000007);
      }
    return v;
  }
  return v = dyn(u, 0, U - 1, B + 1, p, 0);
}
int dfs(int u, int p) {
  for (auto &h : g[u])
    if (h ^ p) D[u] = max(D[u], dfs(h, u)), W[u] += W[h] + 1;
  return D[u] + 1;
}
int main(void) {
  scanf("%d%d", &N, &K), (memset(dp, -1, sizeof(dp))),
      (memset(dx, -1, sizeof(dx)));
  for (int i(0); i < N - 1; i++)
    scanf("%d%d", &a, &b), g[--a].push_back(--b), g[b].push_back(a);
  dfs(0, -1);
  for (int i(0); i < K + 1; i++)
    S += dxh(0, i, K + 3, (101) - 1), S %= (1000000007);
  printf("%d\n", S);
  return 0;
}
