#include <bits/stdc++.h>
using namespace std;
const int N = 100004;
const int mod = 1e9 + 7;
vector<int> g[N];
int n, k;
long long dp[N][50];
long long temp[50];
void dfs(int u, int p) {
  dp[u][0] = 1;
  dp[u][k + 1] = 1;
  for (int x = 0; x < g[u].size(); x++) {
    int v = g[u][x];
    if (v == p) continue;
    dfs(v, u);
    memset(temp, 0, sizeof(temp));
    for (int i = 0; i <= 2 * k; i++) {
      for (int j = 0; j <= 2 * k; j++) {
        if (i <= k && j <= k)
          temp[min(i, j + 1)] =
              (temp[min(i, j + 1)] + dp[u][i] * dp[v][j]) % mod;
        else if (i > k && j > k)
          temp[max(i, j + 1)] =
              (temp[max(i, j + 1)] + dp[u][i] * dp[v][j]) % mod;
        else {
          if (i + j - k <= k)
            temp[min(i, j + 1)] =
                (temp[min(i, j + 1)] + dp[u][i] * dp[v][j]) % mod;
          else
            temp[max(i, j + 1)] =
                (temp[max(i, j + 1)] + dp[u][i] * dp[v][j]) % mod;
        }
      }
    }
    for (int i = 0; i <= 2 * k; i++) dp[u][i] = temp[i];
  }
  return;
}
int main() {
  scanf("%d %d", &n, &k);
  int i;
  for (i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long ans = 0;
  dfs(1, 0);
  for (i = 0; i <= k; i++) ans = (ans + dp[1][i]) % mod;
  printf("%I64d\n", ans);
  return 0;
}
