#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {-1, 1, 0, 0, 1, -1, -1, 1};
int n, k;
vector<int> adj[101], adj2[101];
const ll mod = 1e9 + 7;
void dfs(int x, int from = -1) {
  for (int y : adj[x])
    if (y != from) {
      adj2[x].push_back(y);
      dfs(y, x);
    }
}
int f(int x, int l, int d);
int dp2[111][111][44][44][2];
int g(int x, int i, int l, int dlo, bool have) {
  l = min(l, k + 1);
  if (i == adj2[x].size()) return have;
  int& res = dp2[x][i][l][dlo][have];
  if (res != -1) return res;
  int y = adj2[x][i];
  res = 1ll * f(y, l, -1) * g(x, i + 1, l, dlo, have) % mod;
  for (int d = dlo; d <= 2 * k; ++d)
    res =
        (0ll + res + 1ll * f(y, l, d) * g(x, i + 1, l, dlo, have || dlo == d)) %
        mod;
  return res;
}
int dp3[111][22][44];
int h(int x, int l, int d) {
  if (d > 2 * k) return 0;
  l = min(l, k + 1);
  int& res = dp3[x][l][d];
  if (res != -1) return res;
  return res = (f(x, l, d) + h(x, l, d + 1)) % mod;
}
int dp[111][22][44];
int f(int x, int l, int d) {
  l = min(l, k + 1);
  int cur = 1 << 30;
  if (l >= 0) cur = l;
  if (d >= 0) cur = min(cur, d);
  if (cur > k) return 0;
  int& res = dp[x][l][d];
  if (res != -1) return res;
  if (d == 0) {
    res = 1;
    for (int y : adj2[x]) res = 1ll * res * h(y, 1, -1) % mod;
  } else if (d < 0) {
    res = 1;
    for (int y : adj2[x]) res = (1ll * res * f(y, l + 1, -1)) % mod;
  } else {
    l = (l < 0) ? (d + 1) : min(l + 1, d + 1);
    res = g(x, 0, l, d - 1, 0);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = (0), __ee = (n - 1); i < __ee; ++i) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1);
  memset(dp, -1, sizeof dp);
  memset(dp2, -1, sizeof dp2);
  memset(dp3, -1, sizeof dp3);
  cout << h(1, -1, -1) << "\n";
}
