#include <bits/stdc++.h>
using namespace std;
const long int mod = 1e9 + 7;
long int n, k;
vector<long int> adj[102];
long int dp[102][41];
void dfs(long int u, long int par) {
  dp[u][0] = dp[u][k + 1] = 1;
  for (auto v : adj[u]) {
    if (v == par) continue;
    dfs(v, u);
    vector<long int> nxtState(42, 0);
    for (long int i = 0; i <= 2 * k; i++) {
      if (dp[u][i] == 0) continue;
      for (long int j = 0; j <= 2 * k; j++) {
        long int _add = (1ll * dp[u][i] * dp[v][j]) % mod;
        if (i <= k && j <= k)
          nxtState[min(i, j + 1)] = (nxtState[min(i, j + 1)] + _add) % mod;
        if (i > k && j > k)
          nxtState[max(i, j + 1)] = (nxtState[max(i, j + 1)] + _add) % mod;
        if (i <= k && j > k) {
          if (j - k <= k - i)
            nxtState[i] = (nxtState[i] + _add) % mod;
          else
            nxtState[j + 1] = (nxtState[j + 1] + _add) % mod;
        }
        if (i > k && j <= k) {
          if (i - k <= k - j)
            nxtState[j + 1] = (nxtState[j + 1] + _add) % mod;
          else
            nxtState[i] = (nxtState[i] + _add) % mod;
        }
      }
    }
    for (long int i = 0; i <= 2 * k; i++) dp[u][i] = nxtState[i];
  }
  return;
}
void solve() {
  scanf("%ld %ld", &n, &k);
  for (long int i = 1; i < n; i++) {
    long int u, v;
    scanf("%ld %ld", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  long int ans = 0;
  for (long int i = 0; i <= k; i++) ans = (ans + dp[1][i]) % mod;
  printf("%ld", ans);
  return;
}
int main() {
  solve();
  return 0;
}
