#include <bits/stdc++.h>
using namespace std;
int n, k;
int X[1111];
int Y[1111];
int Pr[1111];
int Next[1111];
const long long md = 1000000007;
long long dp[1111][1111];
const int N = 20;
long long d[111][30][30];
void dfs(int v, int p) {
  for (int i = Pr[v]; i; i = Next[i]) {
    if (Y[i] == p) {
      continue;
    }
    dfs(Y[i], v);
  }
  dp[v][k + N] = 1;
  for (int i = Pr[v]; i; i = Next[i]) {
    if (Y[i] == p) {
      continue;
    }
    long long sum = 0;
    for (int j = -k; j <= k; j++) {
      sum = (sum + dp[Y[i]][j + N]) % md;
    }
    dp[v][k + N] = (dp[v][k + N] * sum) % md;
  }
  memset(d, 0, sizeof(d));
  d[0][0][0] = 1;
  int it = 0;
  for (int i = Pr[v]; i; i = Next[i]) {
    if (Y[i] == p) {
      continue;
    }
    it++;
    for (int j1 = 0; j1 <= k; j1++) {
      for (int j2 = 0; j2 <= k; j2++) {
        for (int ngh = 0; ngh <= k; ngh++) {
          d[it][max(j1, ngh)][j2] = (d[it][max(j1, ngh)][j2] +
                                     d[it - 1][j1][j2] * dp[Y[i]][N - ngh]) %
                                    md;
        }
        for (int poz = 1; poz <= k; poz++) {
          d[it][j1][max(j2, poz)] = (d[it][j1][max(j2, poz)] +
                                     d[it - 1][j1][j2] * dp[Y[i]][N + poz]) %
                                    md;
        }
      }
    }
  }
  for (int j1 = 0; j1 < k; j1++) {
    for (int j2 = 0; j2 <= k; j2++) {
      if (j1 == 0 && j2 == 0) {
        dp[v][-1 + N] = (dp[v][-1 + N] + d[it][j1][j2]) % md;
        continue;
      }
      if (j1 + 1 <= j2) {
        dp[v][j2 - 1 + N] = (dp[v][j2 - 1 + N] + d[it][j1][j2]) % md;
      } else {
        dp[v][-j1 - 1 + N] = (dp[v][-j1 - 1 + N] + d[it][j1][j2]) % md;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    cin >> X[i] >> Y[i];
    X[i + n - 1] = Y[i];
    Y[i + n - 1] = X[i];
  }
  for (int i = 1; i <= n + n - 2; i++) {
    Next[i] = Pr[X[i]];
    Pr[X[i]] = i;
  }
  dfs(1, 0);
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    ans = (ans + dp[1][i + N]) % md;
  }
  cout << ans << endl;
  return 0;
}
