#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k;
vector<int> tree[105];
long long dp[105][45];
long long dp2[45];
void dfs(int u = 0, int p = 0) {
  dp[u][0] = 1;
  dp[u][k + 1] = 1;
  for (auto to : tree[u]) {
    if (to == p) continue;
    dfs(to, u);
    memset(dp2, 0, sizeof dp2);
    for (int i = 0; i <= 2 * k; i++)
      for (int j = 0; j <= 2 * k; j++) {
        if (i <= k && j <= k) {
          (dp2[min(i, j + 1)] += dp[u][i] * dp[to][j]) %= mod;
        } else if (i > k && j > k) {
          (dp2[max(i, j + 1)] += dp[u][i] * dp[to][j]) %= mod;
        } else {
          if (i + j - k <= k)
            (dp2[min(i, j + 1)] += dp[u][i] * dp[to][j]) %= mod;
          else
            (dp2[max(i, j + 1)] += dp[u][i] * dp[to][j]) %= mod;
        }
      }
    for (int i = 0; i <= 2 * k; i++) dp[u][i] = dp2[i];
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i + 1 < n; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  dfs();
  long long ans = 0;
  for (int i = 0; i <= k; i++) (ans += dp[0][i]) %= mod;
  cout << ans << endl;
  return 0;
}
