#include <bits/stdc++.h>
using namespace std;
int f[110][50], ans;
struct Edge {
  int to, old;
} e[110 * 2];
int g[50][50], gg[50][50], h, n, m, i, j, l[110], tot;
inline void Lnk(int x, int y) {
  e[++tot].to = y, e[tot].old = l[x], l[x] = tot;
}
inline void Add(int &a, int b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
inline void Dp(int x, int y) {
  int s = 0;
  for (int i = l[x]; i; i = e[i].old)
    if (e[i].to != y) Dp(e[i].to, x);
  memset(g, 0, sizeof(g));
  for (int i = l[x]; i; i = e[i].old)
    if (e[i].to != y) {
      int v = e[i].to;
      if (!s) {
        for (int j = -m - 1; j <= m; j++) g[j + h + 1][j + 1 + h] = f[v][j + h];
        s++;
        continue;
      }
      for (int j = -m - 1; j <= m; j++)
        for (int k = -m - 1; k <= m; k++)
          gg[j + h][k + h] = g[j + h][k + h], g[j + h][k + h] = 0;
      for (int j = -m - 1; j <= m; j++)
        for (int k = -m - 1; k <= m; k++)
          if (gg[j + h][k + h]) {
            for (int l = -m - 1; l <= m; l++) {
              int jj = max(j, l + 1), kk = min(k, l + 1);
              Add(g[jj + h][kk + h],
                  gg[j + h][k + h] * 1ll * f[v][l + h] % 1000000007);
            }
          }
      s++;
    }
  if (!s) {
    f[x][-m - 1 + h] = f[x][0 + h] = 1;
    return;
  }
  if (x == 4) int deb = 0;
  for (int i = -m - 1; i <= m; i++)
    for (int j = -m - 1; j <= m; j++)
      if (g[i + h][j + h]) {
        int nm = g[i + h][j + h];
        Add(f[x][-m - 1 + h], nm);
        if (i + j < 0) {
          Add(f[x][j + h], nm);
          continue;
        }
        if (i == m || (x == 1 && i >= 0)) continue;
        Add(f[x][i + h], nm);
      }
}
int main() {
  scanf("%d%d", &n, &m), h = m + 1;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    Lnk(u, v), Lnk(v, u);
  }
  if (!m) {
    puts("1");
    return (0);
  }
  Dp(1, 0);
  for (int i = -m - 1; i <= m; i++) Add(ans, f[1][i + h]);
  printf("%d\n", ans);
}
