#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
const long double PI = acos((long double)(-1));
using namespace std;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};
int n, k;
vector<vector<int>> g;
vector<vector<mint>> dp;
void dfs(int cur, int pre) {
  dp[cur][0] = 1;
  dp[cur][k + 1] = 1;
  for (auto nxt : g[cur]) {
    if (nxt == pre) continue;
    dfs(nxt, cur);
    vector<mint> ndp(k * 2 + 3);
    for (int i = 0; i <= k * 2; i++) {
      for (int j = 0; j <= k * 2; j++) {
        int t = min(i, j + 1);
        if (i + j > 2 * k) t = max(i, j + 1);
        ndp[t] += dp[cur][i] * dp[nxt][j];
      }
    }
    dp[cur] = ndp;
  }
}
int main() {
  scanf("%d %d", &n, &k);
  g.resize(n);
  dp.assign(n, vector<mint>(k * 2 + 3));
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  dfs(0, -1);
  mint res = 0;
  for (int i = 0; i <= k; i++) res += dp[0][i];
  cout << res.x << "\n";
  return 0;
}
