#include <bits/stdc++.h>
using namespace std;
const long long mo = 1000000007;
long long dp[105][45], n, h[105], m, tot, ss[45][45];
struct DX {
  long long v, w, p;
} dx[205];
void add(long long u, long long v) {
  dx[++tot].p = h[u];
  dx[tot].v = v;
  h[u] = tot;
}
void dfs(long long u, long long fx) {
  dp[u][0] = 1;
  dp[u][m + 1] = 1;
  for (long long i = h[u]; i; i = dx[i].p) {
    long long v = dx[i].v;
    if (v == fx) continue;
    dfs(v, u);
    memset(ss, 0, sizeof(ss));
    for (long long j = 0; j <= 2 * m; j++) {
      for (long long k = 0; k <= 2 * m - j; k++)
        (ss[k][min(k, j + 1)] += dp[v][j]) %= mo;
      for (long long k = 2 * m - j + 1; k <= 2 * m; k++)
        (ss[k][max(k, j + 1)] += dp[v][j]) %= mo;
    }
    for (long long j = 0; j <= 2 * m; j++)
      for (long long k = 0; k <= 2 * m; k++) (ss[j][k] *= dp[u][j]) %= mo;
    for (long long k = 0; k <= 2 * m; k++) {
      dp[u][k] = 0;
      for (long long j = 0; j <= 2 * m; j++) (dp[u][k] += ss[j][k]) %= mo;
    }
  }
}
int main() {
  long long a, b;
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i < n; i++) {
    scanf("%lld%lld", &a, &b);
    add(a, b);
    add(b, a);
  }
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  dfs(1, 1);
  long long ans = 0;
  for (long long i = 0; i <= m; i++) (ans += dp[1][i]) %= mo;
  printf("%lld", ans);
  return 0;
}
