#include <bits/stdc++.h>
using namespace std;
vector<vector<vector<long long> > > dp;
vector<vector<long long> > g;
vector<long long> sum;
int k;
const long long mod = 1e9 + 7;
void dfs(int v, int p) {
  dp[v][0][k] = 1;
  long long x = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to != p) {
      dfs(to, v);
      sum[to] = 0;
      vector<vector<long long> > tmp(k + 1, vector<long long>(k + 1, 0));
      int ni, nj;
      for (int a = 0; a <= k; a++) {
        for (int b = 0; b <= k; b++) {
          for (int c = 0; c <= k; c++) {
            if (c == k - 1) continue;
            for (int d = 0; d <= k; d++) {
              nj = min(b, d + 1);
              ni = max(a, c + 1) <= k ? max(a, c + 1) : k;
              if (a == k && c == k) {
                ni = k;
              } else {
                if (c == k)
                  ni = a;
                else {
                  if (a == k)
                    ni = c + 1;
                  else
                    ni = max(a, c + 1);
                }
              }
              if (d == k - 1 && a == 0 && c == k) ni = k;
              if (nj < k && nj + ni <= k) ni = k;
              tmp[ni][nj] = (tmp[ni][nj] + dp[v][a][b] * dp[to][c][d]) % mod;
            }
          }
          sum[to] += dp[to][a][b];
          sum[to] %= mod;
        }
      }
      dp[v] = tmp;
      x = (x * sum[to]) % mod;
    }
  }
  dp[v][k][0] = x;
  sum[v] = x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n >> k;
  int x, y;
  g.resize(n);
  dp.resize(n);
  sum.resize(n);
  for (int i = 0; i < n; i++) {
    dp[i].resize(k + 1);
    for (int j = 0; j < dp[i].size(); j++) dp[i][j].assign(k + 1, 0);
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(0, -1);
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    ans += dp[0][k][i];
    ans %= mod;
  }
  cout << ans;
  return 0;
}
