#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chkmin(T1 &first, T2 second) {
  if (first > second) first = second;
}
template <typename T1, typename T2>
inline void chkmax(T1 &first, T2 second) {
  if (first < second) first = second;
}
const string FILENAME = "input";
const int MAXN = 101, MAXK = 21, p = 1e9 + 7;
int n, k;
int sum(int a, int b) {
  a += b;
  if (a >= p) a -= p;
  return a;
}
int mul(long long a, int b) { return (a * b) % p; }
int up[101][22][2];
int down[101][22][2];
vector<int> edge[101];
void dfs(int i, int p) {
  for (int j : edge[i]) {
    if (j == p) continue;
    dfs(j, i);
  }
  up[i][k][1] = 1;
  for (int j : edge[i]) {
    if (j == p) continue;
    int res = 0;
    for (int q = 0; q < k; ++q) {
      res = sum(res, down[j][q][1]);
    }
    for (int q = 0; q <= k; ++q) {
      res = sum(res, up[j][q][1]);
    }
    up[i][k][1] = mul(up[i][k][1], res);
  }
  for (int q = 0; q < k; ++q) {
    up[i][q][0] = 1;
    for (int j : edge[i]) {
      if (j == p) continue;
      int res0 = 0, res1 = 0;
      for (int r = 0; r <= q + 1; ++r) {
        if (r == q + 1) {
          res1 = sum(res1, up[j][r][1]);
        } else {
          res0 = sum(res0, up[j][r][1]);
        }
      }
      for (int r = 0; r < q; ++r) {
        res0 = sum(res0, down[j][r][1]);
      }
      int L = up[i][q][0], R = up[i][q][1];
      up[i][q][0] = mul(L, res0);
      up[i][q][1] = sum(mul(L, res1), mul(R, sum(res0, res1)));
    }
  }
  for (int q = 0; q < k; ++q) {
    down[i][q][0] = 1;
    if (q == 0) down[i][q][1] = 1;
    for (int j : edge[i]) {
      if (j == p) continue;
      int res0 = 0, res1 = 0;
      for (int r = 0; r <= q; ++r) {
        res0 = sum(res0, up[j][r][1]);
      }
      for (int r = 0; r < q; ++r) {
        if (r == q - 1) {
          res1 = sum(res1, down[j][r][1]);
        } else {
          res0 = sum(res0, down[j][r][1]);
        }
      }
      int L = down[i][q][0], R = down[i][q][1];
      down[i][q][0] = mul(L, res0);
      down[i][q][1] = sum(mul(L, res1), mul(R, sum(res0, res1)));
    }
  }
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i < n; ++i) {
    int L, R;
    cin >> L >> R;
    --L, --R;
    edge[L].push_back(R);
    edge[R].push_back(L);
  }
  dfs(0, -1);
  int res = 0;
  for (int i = 0; i <= k; ++i) {
    res = sum(res, up[0][i][1]);
  }
  cout << res << endl;
}
