#include <bits/stdc++.h>
using namespace std;
int IN() {
  int x = 0, f = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';) f = (ch == '-');
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) x = x * 10 + ch - '0';
  return f ? -x : x;
}
int N, M, D, st[105];
int F[105][25 << 1], G[2][25 << 1][25 << 1];
struct Lin {
  int v, next;
} E[105 << 1];
void Link(int u, int v) {
  E[++D] = (Lin){v, st[u]};
  st[u] = D;
  E[++D] = (Lin){u, st[v]};
  st[v] = D;
}
void Plu(int& a, int b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
void DFS(int u, int f) {
  int tot = 0;
  for (int i = st[u], v; i; i = E[i].next)
    if ((v = E[i].v) != f) DFS(v, u), tot++;
  if (!tot) {
    F[u][M + M] = 1;
    F[u][M - 1] = 1;
  }
  for (int p = 0, lim = 1; p <= lim; p++)
    for (int a = 0, lim = M * 2; a <= lim; a++)
      for (int b = 0, lim = M * 2; b <= lim; b++) G[p][a][b] = 0;
  G[0][2 * M][0] = 1;
  int p = 0, q = 1;
  for (int i = st[u], v; i; i = E[i].next)
    if ((v = E[i].v) != f) {
      p ^= 1;
      q ^= 1;
      for (int a = 0, lim = M * 2; a <= lim; a++)
        for (int b = 0, lim = M * 2; b <= lim; b++) G[p][a][b] = 0;
      for (int a = 0, lim = M * 2; a <= lim; a++)
        for (int b = 0, lim = M * 2; b <= lim; b++)
          if (G[q][a][b])
            for (int c = 0, lim = M * 2; c <= lim; c++)
              Plu(G[p][min(a, c)][max(b, c)],
                  1ll * G[q][a][b] * F[v][c] % 1000000007);
    }
  for (int a = 0, lim = M * 2; a <= lim; a++)
    for (int b = a, lim = M * 2; b <= lim; b++) {
      if (a - M + b - M >= 1) {
        Plu(F[u][M + M], G[p][a][b]);
        Plu(F[u][b - 1], G[p][a][b]);
      } else if (a == 0) {
        Plu(F[u][M + M], G[p][a][b]);
      } else {
        Plu(F[u][M + M], G[p][a][b]);
        Plu(F[u][a - 1], G[p][a][b]);
      }
    }
}
int main(int argc, char* argv[]) {
  N = IN();
  M = IN();
  for (int i = 2, lim = N; i <= lim; i++) Link(IN(), IN());
  if (M == 0) return puts("1"), 0;
  DFS(1, 0);
  int Ans = 0;
  for (int c = M, lim = 2 * M; c <= lim; c++) Plu(Ans, F[1][c]);
  printf("%d\n", Ans);
  return 0;
}
