#include <bits/stdc++.h>
using namespace std;
const int maxn = 105, modd = 1e9 + 7;
struct zs {
  int too, pre;
} e[maxn << 1];
int tot, last[maxn];
int f[maxn][42][22], tmp[maxn][42][22], MX, KK;
int i, j, k, n, m;
int ra, fh;
char rx;
inline int read() {
  ra = 0, fh = 1, rx = getchar();
  while (rx < '0' || rx > '9') rx == '-' && (fh = -1), rx = getchar();
  while (rx >= '0' && rx <= '9') ra = ra * 10 + rx - 48, rx = getchar();
  return ra * fh;
}
inline void insert(int a, int b) {
  e[++tot].too = b, e[tot].pre = last[a], last[a] = tot, e[++tot].too = a,
  e[tot].pre = last[b], last[b] = tot;
}
void dfs(int x, int fa) {
  int i, to;
  bool leaf = 1;
  for (i = last[x]; i; i = e[i].pre)
    if (e[i].too != fa) dfs(e[i].too, x), leaf = 0;
  if (leaf) {
    f[x][0][MX] = 1, f[x][MX + 1][0] = 1;
    return;
  }
  memset(tmp[0], 0, sizeof(tmp[0]));
  bool now = 1, pre = 0, fir = 1, f1, f2;
  int j, k, mn, mx, pf, nf, toj;
  for (i = last[x]; i; i = e[i].pre)
    if (e[i].too != fa) {
      to = e[i].too;
      memset(tmp[now], 0, sizeof(tmp[now]));
      if (fir) {
        fir = 0;
        for (j = 1; j <= KK * 2; j++)
          for (k = 1; k < MX; k++) tmp[now][j][k] = f[to][j - 1][k - 1];
        tmp[now][KK + 1][0] = f[to][KK][MX];
        for (j = 1; j <= KK; j++) tmp[now][j][MX] = f[to][j - 1][MX];
        for (nf = 0, j = 0; j <= KK * 2; j++)
          for (k = 0; k <= MX; k++)
            nf += f[to][j][k], nf -= nf >= modd ? modd : 0;
        tmp[now][0][MX] = nf;
      } else {
        for (j = 0; j <= KK * 2; j++)
          for (k = 0; k <= MX; k++)
            if ((pf = f[to][j][k])) {
              tmp[now][0][MX] += 1ll * pf * tmp[pre][0][MX] % modd,
                  tmp[now][0][MX] -= tmp[now][0][MX] >= modd ? modd : 0;
              for (mn = 1; mn <= KK * 2; mn++)
                for (mx = 0; mx <= MX; mx++)
                  if (tmp[pre][mn][mx]) {
                    nf = 1ll * pf * tmp[pre][mn][mx] % modd,
                    toj = mn <= j ? mn : j + 1, f1 = j + mx + 1 > KK,
                    f2 = k + mn + 1 > KK;
                    if (k + 1 == KK && f2) continue;
                    if ((!f1 || mx == MX) && (!f2 || k == MX))
                      tmp[now][toj][MX] += nf,
                          tmp[now][toj][MX] -=
                          tmp[now][toj][MX] >= modd ? modd : 0;
                    else if (f1 && (k < mx || k == MX) && mx != MX)
                      tmp[now][toj][mx] += nf,
                          tmp[now][toj][mx] -=
                          tmp[now][toj][mx] >= modd ? modd : 0;
                    else if (f2 && (k >= mx || mx == MX) && k != MX)
                      tmp[now][toj][k + 1] += nf,
                          tmp[now][toj][k + 1] -=
                          tmp[now][toj][k + 1] >= modd ? modd : 0;
                  }
            }
      }
      swap(now, pre);
    }
  memcpy(f[x], tmp[pre], sizeof(f[x]));
}
int main() {
  n = read(), KK = read(), MX = KK;
  if (!KK) return puts("1"), 0;
  for (i = 1; i < n; i++) insert(read(), read());
  dfs(1, 0);
  int ans = 0;
  for (i = 0; i <= KK; i++) ans += f[1][i][MX], ans -= ans >= modd ? modd : 0;
  printf("%d\n", ans);
}
