#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void upd(int &x, int y) {
  x += y;
  if (x >= mod) {
    x -= mod;
  }
}
int mul(int x, int y) { return 1LL * x * y % mod; }
int n, K;
vector<int> g[100];
int dp0[100][30][30];
int dp1[100][30][30];
void dfs(int u, int p) {
  dp0[u][K][1 - 0] = 1;
  dp0[u][0][1 - 1] = 1;
  for (int v : g[u]) {
    if (v == p) {
      continue;
    }
    dfs(v, u);
    memset(dp1[u], 0, sizeof(dp1[u]));
    for (int j = 0; j <= K; j++) {
      for (int jj = -1; jj <= K; jj++) {
        for (int k = -1; k <= K; k++) {
          for (int kk = -1; kk <= K; kk++) {
            int nk = -1;
            if (j + 1 + kk > K) {
              nk = max(nk, kk + 1);
            }
            if (jj + 1 + k > K) {
              nk = max(nk, k);
            }
            upd(dp1[u][min(j, jj + 1)][1 + nk],
                mul(dp0[u][j][1 + k], dp0[v][jj][1 + kk]));
          }
        }
      }
    }
    swap(dp0[u], dp1[u]);
  }
}
int main() {
  cin >> n >> K;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(0, -1);
  int ans = 0;
  for (int j = 0; j <= K; j++) {
    upd(ans, dp0[0][j][0]);
  }
  cout << ans << endl;
}
