#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int head[N], cnt, n, k, f[N][55], g[55];
struct Edge {
  int next, to;
} edge[N << 2];
void save(int a, int b) { edge[cnt] = (Edge){head[a], b}, head[a] = cnt++; }
const int mod = 1e9 + 7;
void Add(int &x, const int &y) {
  x += y;
  if (x >= mod) x -= mod;
}
int mul(const int &x, const int &y) { return 1ll * x * y % mod; }
int D(int t) { return t + k; }
void dfs(int x, int fa = 0) {
  f[x][D(-k)] = 1;
  f[x][D(1)] = 1;
  for (int i = head[x]; ~i; i = edge[i].next) {
    if (edge[i].to == fa) continue;
    dfs(edge[i].to, x);
    memset(g, 0, sizeof(g));
    for (int d = -k; d <= k; d++) {
      if (!f[x][D(d)]) continue;
      for (int d0 = -k; d0 <= k; ++d0) {
        if (!f[edge[i].to][D(d0)]) continue;
        int dd = d0 + 1, tmp;
        if (d > 0 && d0 > 0)
          tmp = max(d, dd);
        else if (d > 0 && d0 <= 0)
          tmp = -d0 >= d ? dd : d;
        else if (d <= 0 && d0 > 0)
          tmp = -d >= d0 ? d : dd;
        else
          tmp = min(dd, d);
        Add(g[D(tmp)], mul(f[x][D(d)], f[edge[i].to][D(d0)]));
      }
    }
    memcpy(f[x], g, sizeof(g));
  }
}
int main() {
  memset(head, -1, sizeof(head));
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n - 1; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    save(a, b), save(b, a);
  }
  dfs(1);
  int ans = 0;
  for (int i = -k; i <= 0; ++i) Add(ans, f[1][D(i)]);
  printf("%d\n", ans);
  return 0;
}
