#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T b, T p, T M) {
  long long ret = 1;
  for (; p > 0; p >>= 1) {
    if (p & 1) ret = (ret * b) % M;
    b = (b * b) % M;
  }
  return (T)ret;
}
template <class T>
inline T __lcm(T a, T b) {
  return (a * b) / __gcd(a, b);
}
int dx4[] = {1, 0, -1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};
int kx8[] = {1, 1, 2, 2, -1, -1, -2, -2};
int ky8[] = {2, -2, 1, -1, 2, -2, 1, -1};
struct z {
  int u, v, w;
  z() {}
  z(int _u, int _v, int _w) { u = _u, v = _v, w = _w; }
  bool friend operator<(z a, z b) { return a.w < b.w; }
};
const double PI = acos(-1.0), EPS = 1e-7;
const long long INF = 1e18;
const int N = 100 + 5, M = 1e9 + 7, NIL = -1;
int n, k, lim;
vector<int> G[N];
long long dp[N][N], cnt[N];
void dfs(int u, int p) {
  dp[u][0] = dp[u][k + 1] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v != p) {
      dfs(v, u);
      memset(cnt, 0, sizeof cnt);
      for (int x = 0; x < lim + 1; x++) {
        for (int y = 0; y < lim + 1; y++) {
          if (x + y <= lim) {
            int d = min(x, y + 1);
            cnt[d] += dp[u][x] * dp[v][y];
            cnt[d] %= M;
          } else {
            int d = max(x, y + 1);
            cnt[d] += dp[u][x] * dp[v][y];
            cnt[d] %= M;
          }
        }
      }
      memcpy(dp[u], cnt, sizeof dp[u]);
    }
  }
}
int main() {
  cin >> n >> k;
  lim = k << 1;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(1, -1);
  long long ans = 0;
  for (int i = 0; i < k + 1; i++) {
    ans += dp[1][i];
    ans %= M;
  }
  cout << ans << endl;
  return 0;
}
