#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int MAXN = 105;
const int MAXK = 25;
const int MOD = 1e9 + 7;
int n, max_len;
int dist[MAXN][MAXN];
int dp[MAXN][MAXK][MAXK];
int ch_dp[MAXN][MAXK][MAXK];
bool was[MAXN][MAXK][MAXK];
vector<int> children[MAXN];
void mod_add(int &x, int val) {
  x += val;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
void dfs(int v, int pr) {
  for (int i = 1; i <= n; i++) {
    if (dist[v][i] == 1 and i != pr) {
      children[v].push_back(i);
      dfs(i, v);
    }
  }
}
int fastpow(int a, int pw) {
  int res = 0;
  while (pw) {
    if (pw & 1) mod_add(res, a);
    mod_add(a, a);
    pw >>= 1;
  }
  return res;
}
int get(int, int, int);
void rec(int v, vector<int> &ch) {
  memset(ch_dp, 0, sizeof(ch_dp));
  ch_dp[0][0][MAXK - 1] = 1;
  for (size_t idx = 0; idx < ch.size(); idx++) {
    for (int i = 0; i < MAXK; i++) {
      for (int j = 0; j < MAXK; j++) {
        int rrr = ch_dp[idx][i][j];
        if (rrr == 0) continue;
        for (int i2 = 0; i2 <= max_len + 1; i2++) {
          for (int j2 = 0; j2 <= max_len + 1; j2++) {
            int new_rrr = (rrr * 1ll) * dp[ch[idx]][i2][j2] % MOD;
            mod_add(ch_dp[idx + 1][max(i, i2)][min(j, j2)], new_rrr);
          }
        }
      }
    }
  }
  for (int max_unc = 0; max_unc - 1 < max_len; max_unc++) {
    for (int min_pain = 0; min_pain <= max_len + 1; min_pain++) {
      if (ch_dp[ch.size()][max_unc][min_pain] == 0) continue;
      {
        int new_unc = 0;
        int new_dep = 0;
        mod_add(dp[v][new_unc][new_dep], ch_dp[ch.size()][max_unc][min_pain]);
      }
      {
        int new_unc = max_unc + 1;
        int new_dep = min_pain + 1;
        if (min_pain == max_len + 1) new_dep = max_len + 1;
        if (max_len - min_pain - 1 >= max_unc) new_unc = 0;
        mod_add(dp[v][new_unc][new_dep], ch_dp[ch.size()][max_unc][min_pain]);
      }
    }
  }
}
void go(int v) {
  if (children[v].empty()) {
    dp[v][1][max_len + 1] = 1;
    dp[v][0][0] = 1;
    return;
  }
  for (const auto &u : children[v]) go(u);
  rec(v, children[v]);
}
int get(int v, int max_depth_uncovered, int min_depth_painted) {
  if (was[v][max_depth_uncovered][min_depth_painted])
    return dp[v][max_depth_uncovered][min_depth_painted];
  was[v][max_depth_uncovered][min_depth_painted] = true;
  int &res = dp[v][max_depth_uncovered][min_depth_painted];
  return res;
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> max_len;
  if (max_len == 0) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      if (i != j) dist[i][j] = n + 2;
  for (int i = 0; i < n - 1; i++) {
    int fr, to;
    cin >> fr >> to;
    dist[fr][to] = dist[to][fr] = 1;
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
  int diam = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) diam = max(diam, dist[i][j]);
  {
    dfs(1, 0);
    go(1);
    int ans = 0;
    for (int i = 0; i <= max_len + 1; i++) mod_add(ans, get(1, 0, i));
    cout << ans << endl;
  }
  return 0;
}
