#include <bits/stdc++.h>
using namespace std;
template <typename T>
T Abs(T first) {
  return (first < 0 ? -first : first);
}
template <typename T>
T Sqr(T first) {
  return (first * first);
}
string plural(string s) {
  return (int((s).size()) && s[int((s).size()) - 1] == 'x' ? s + "en"
                                                           : s + "s");
}
const int INF = (int)1e9;
const long double EPS = 1e-12;
const long double PI = acos(-1.0);
bool Read(int &first) {
  char c, r = 0, n = 0;
  first = 0;
  for (;;) {
    c = getchar();
    if ((c < 0) && (!r)) return (0);
    if ((c == '-') && (!r))
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      first = first * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) first = -first;
  return (1);
}
int N, K;
vector<int> con[100];
int dynE[100][22], dynR[100][22];
void Add(int &a, int b) { a = (a + b) % 1000000007; }
void Mult(int &a, int b) { a = (long long)a * b % 1000000007; }
void rec(int i, int p) {
  int j, k, a, b, v, v2, V, V2, s, s2;
  vector<int> ch;
  for (j = 0; j < int((con[i]).size()); j++)
    if ((k = con[i][j]) != p) {
      rec(k, i);
      ch.push_back(k);
    }
  v = 1;
  for (j = 0; j < int((ch).size()); j++) {
    k = ch[j];
    v2 = 0;
    for (a = 0; a < K + 1; a++) Add(v2, dynE[k][a]);
    for (a = 0; a < K; a++) Add(v2, dynR[k][a]);
    Mult(v, v2);
  }
  dynE[i][K] = v;
  if (!int((ch).size())) {
    dynR[i][0] = 1;
    return;
  }
  for (a = 0; a < K; a++) {
    v = 1, v2 = 0;
    for (j = 0; j < int((ch).size()); j++) {
      k = ch[j];
      s2 = dynE[k][a + 1];
      s = 0;
      for (b = 0; b < a + 1; b++) Add(s, dynE[k][b]);
      for (b = 0; b < a; b++) Add(s, dynR[k][b]);
      V = (long long)v * s % 1000000007;
      V2 = ((long long)(v + v2) * s2 % 1000000007 +
            (long long)v2 * s % 1000000007) %
           1000000007;
      v = V;
      v2 = V2;
    }
    dynE[i][a] = v2;
  }
  for (a = 0; a < K; a++) {
    v = 1, v2 = 0;
    for (j = 0; j < int((ch).size()); j++) {
      k = ch[j];
      s2 = a ? dynR[k][a - 1] : dynE[k][0];
      s = 0;
      for (b = 0; b < a - 1; b++) Add(s, dynR[k][b]);
      if (a)
        for (b = 0; b < a + 1; b++) Add(s, dynE[k][b]);
      V = (long long)v * s % 1000000007;
      V2 = ((long long)(v + v2) * s2 % 1000000007 +
            (long long)v2 * s % 1000000007) %
           1000000007;
      v = V;
      v2 = V2;
    }
    dynR[i][a] = v2;
  }
}
int main() {
  if (0) freopen("in.txt", "r", stdin);
  int i, j, k, ans;
  Read(N), Read(K);
  for (i = 0; i < N - 1; i++) {
    Read(j), Read(k), j--, k--;
    con[j].push_back(k);
    con[k].push_back(j);
  }
  rec(0, 0);
  ans = 0;
  for (i = 0; i < K + 1; i++) Add(ans, dynE[0][i]);
  printf("%d\n", ans);
  return (0);
}
