#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T1, class T2>
inline void gn(T1 &x1, T2 &x2) {
  gn(x1), gn(x2);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
const int mod = 1000000007;
vector<int> adj[111];
int dp[111][50], k;
int tmp[50];
inline void add(int &a, long long b) { a = (a + b) % mod; }
void dfs(int u, int f = 0) {
  dp[u][25 + k] = 1;
  dp[u][25 - 1] = 1;
  for (int v : adj[u]) {
    if (v == f) continue;
    dfs(v, u);
    for (int i = -k; i <= k; i++)
      tmp[25 + i] = dp[u][25 + i], dp[u][25 + i] = 0;
    for (int i = -k; i <= k; i++)
      for (int j = -k; j <= k; j++) {
        if (i + j >= 0)
          add(dp[u][25 + max(i, j - 1)],
              (long long)tmp[25 + i] * dp[v][25 + j]);
        else
          add(dp[u][25 + min(i, j - 1)],
              (long long)tmp[25 + i] * dp[v][25 + j]);
      }
  }
}
int main() {
  int n;
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    gn(u, v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1);
  int ans = 0;
  for (int i = 0; i <= k; i++) add(ans, dp[1][25 + i]);
  cout << ans << endl;
  return 0;
}
