#include <bits/stdc++.h>
using namespace std;
int dp[2005][2005], f[2005], head[2005], n, k, x, y, kk;
struct Tree {
  int nxt, to;
} e[2005];
inline void link(int x, int y) {
  e[++kk].nxt = head[x];
  e[kk].to = y;
  head[x] = kk;
}
void dfs(int u, int fa) {
  dp[u][0] = dp[u][k + 1] = 1;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs(v, u);
    memset(f, 0, sizeof(f));
    for (int j = 0; j <= 2 * k; j++) {
      for (int p = 0; p <= 2 * k; p++) {
        if (j + p <= 2 * k) {
          f[min(p + 1, j)] += (1ll * dp[u][j] * dp[v][p]) % 1000000007;
          f[min(p + 1, j)] %= 1000000007;
        } else {
          f[max(p + 1, j)] += (1ll * dp[u][j] * dp[v][p]) % 1000000007;
          f[max(p + 1, j)] %= 1000000007;
        }
      }
    }
    for (int j = 0; j <= 2 * k; j++) dp[u][j] = f[j];
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    link(x, y);
    link(y, x);
  }
  dfs(1, 0);
  long long ans = 0;
  for (int i = 0; i <= k; i++) ans = 1ll * (ans + dp[1][i]) % 1000000007;
  printf("%lld\n", ans);
  return 0;
}
