#include <bits/stdc++.h>
using namespace std;
const long long maxn = 110;
const long long mod = 1e9 + 7;
long long n, k, dp[maxn][24][24], cp[maxn][24][24];
vector<long long> g[maxn];
void dfs(long long v, long long p) {
  vector<long long> vv;
  for (auto u : g[v]) {
    if (u != p) {
      dfs(u, v);
      vv.push_back(u);
    }
  }
  for (long long i = 1; i <= k + 1; i++) {
    long long ans = 1;
    for (auto u : vv) {
      long long sum = 0;
      for (long long j = 0; j <= k + 1; j++) {
        sum = (sum + dp[u][1][j]) % mod;
      }
      ans = ((ans % mod) * 1ll * (sum % mod)) % mod;
    }
    dp[v][i][0] = ans % mod;
    for (long long j = 1; j <= k + 1; j++) {
      cp[0][k + 1][j] = 1;
    }
    for (long long z = 1; z <= vv.size(); z++) {
      long long u = vv[z - 1];
      for (long long d1 = 1; d1 <= k + 1; d1++) {
        for (long long d2 = 1; d2 <= k + 1; d2++) {
          long long sum = 0;
          for (long long j = d1; j <= k + 1; j++) {
            long long x = min(i + 1, min(d1 + 1, d2 + 1));
            if (x > (k + 1)) x = k + 1;
            long long now = (cp[z - 1][d1][min(d2, min(j + 1, k + 1))] * 1ll *
                             dp[u][x][j]) %
                            mod;
            sum = (sum + now) % mod;
            x = min(i + 1, min(j + 1, d2 + 1));
            if (x > (k + 1)) x = k + 1;
            now = (dp[u][x][d1 - 1] * 1ll * cp[z - 1][j][min(d2, d1)]);
            sum = (sum + now) % mod;
          }
          cp[z][d1][d2] = sum % mod;
        }
      }
    }
    for (long long j = 1; j <= k + 1; j++) {
      if (i == k + 1 && j == k + 1) {
        dp[v][i][j] = 0;
        continue;
      }
      dp[v][i][j] = cp[vv.size()][j][k + 1] % mod;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (long long i = 1; i < n; i++) {
    long long v, u;
    cin >> v >> u;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 0);
  long long ans = 0;
  for (long long i = 0; i <= k; i++) {
    ans = (ans + dp[1][k + 1][i]) % mod;
  }
  cout << ans % mod;
  return 0;
}
