#include <bits/stdc++.h>
using namespace std;
inline void add(int &u, long long x) { u = (u + x) % 1000000007; }
int n, k, dp[101][41], tmp[41];
vector<int> adj[101];
inline void dfs(int u, int fa = 0) {
  dp[u][20 - 1] = 1;
  int mul = 1, x;
  long long sum;
  for (int v : adj[u])
    if (v != fa) {
      dfs(v, u);
      for (int i = -k; i <= k; i++)
        tmp[20 + i] = dp[u][20 + i], dp[u][20 + i] = 0;
      sum = 0;
      for (int i = -k; i <= k; i++) {
        for (int j = -k; j <= k; j++) {
          if (i + j >= 0)
            add(dp[u][20 + max(i, j - 1)],
                (long long)tmp[20 + i] * dp[v][20 + j]);
          else {
            x = 20 + min(i, j - 1);
            if (x >= 0) add(dp[u][x], (long long)tmp[20 + i] * dp[v][20 + j]);
          }
        }
        sum += dp[v][20 + i];
      }
      mul = mul * (sum % 1000000007) % 1000000007;
    }
  add(dp[u][20 + k], mul);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1);
  long long ans = 0;
  for (int i = 0; i <= k; i++) ans += dp[1][20 + i];
  printf("%d", ans % 1000000007);
}
