#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k;
long long temp[55];
long long dp[105][55], ans;
vector<int> g[105];
void dfs(int u, int fa) {
  dp[u][0] = 1;
  dp[u][1 + k] = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v != fa) {
      dfs(v, u);
      for (int j = 0; j <= 2 * k + 1; j++) temp[j] = 0;
      for (int dep1 = 0; dep1 <= 2 * k + 1; dep1++) {
        for (int dep2 = 0; dep2 <= 2 * k; dep2++) {
          if (dep1 + dep2 <= 2 * k)
            temp[min(dep1, dep2 + 1)] =
                (temp[min(dep1, dep2 + 1)] + dp[u][dep1] * dp[v][dep2] % mod) %
                mod;
          else
            temp[max(dep1, dep2 + 1)] =
                (temp[max(dep1, dep2 + 1)] + dp[u][dep1] * dp[v][dep2] % mod) %
                mod;
        }
      }
      for (int j = 0; j <= 2 * k + 1; j++) dp[u][j] = temp[j];
    }
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1, u, v; i < n; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  for (int i = 0; i <= k; i++) ans = (ans + dp[1][i]) % mod;
  cout << ans;
  return 0;
}
