#include <bits/stdc++.h>
using namespace std;
FILE *in;
FILE *out;
const int MAX = 102;
const int MM = 42;
const int MOD = 1000000007;
int n, k;
bool vis[MAX];
vector<int> v[MAX], w[MAX];
int dyn[MAX][MM][MM];
int mlevel[MAX];
int recurse(int node, int lim, int up) {
  int &ans = dyn[node][lim][up];
  if (ans != -1) return ans;
  ans = 0;
  if (lim == 0) {
    long long cur = 1;
    for (int child = 0; child < (int)v[node].size(); child++) {
      int sum = 0;
      for (int dist = 0; dist <= k * 2; dist++) {
        sum += recurse(v[node][child], dist, 1);
        if (sum >= MOD) sum -= MOD;
      }
      if (mlevel[v[node][child]] + 1 <= k) sum++;
      cur = (cur * sum) % MOD;
    }
    ans += cur;
    if (ans >= MOD) ans -= MOD;
  }
  if (lim > 0) {
    int closest = lim - 1;
    for (int which = 0; which < (int)v[node].size(); which++) {
      long long cur = recurse(v[node][which], closest, up + 1);
      for (int child = 0; child < (int)v[node].size(); child++) {
        if (child == which) continue;
        int lower = (child < which ? closest + 1 : closest);
        int upper = k * 2 + 1 - min(closest + 2, up + 1);
        int sum = 0;
        for (int dist = lower; dist <= upper; dist++) {
          sum += recurse(v[node][child], dist, min(closest + 2, up + 1));
          if (sum >= MOD) sum -= MOD;
        }
        if (mlevel[v[node][child]] + min(closest + 2, up + 1) <= k) sum++;
        cur = (cur * sum) % MOD;
      }
      ans += cur;
      if (ans >= MOD) ans -= MOD;
    }
  }
  return ans;
}
int fill(int node) {
  vis[node] = true;
  mlevel[node] = 0;
  for (int i = 0; i < (int)w[node].size(); i++) {
    if (!vis[w[node][i]]) {
      v[node].push_back(w[node][i]);
      mlevel[node] = max(mlevel[node], fill(w[node][i]) + 1);
    }
  }
  return mlevel[node];
}
int main(void) {
  in = stdin;
  out = stdout;
  fscanf(in, "%d %d", &n, &k);
  for (int i = 0; i < n - 1; i++) {
    int node1, node2;
    fscanf(in, "%d %d", &node1, &node2);
    node1--, node2--;
    w[node1].push_back(node2);
    w[node2].push_back(node1);
  }
  memset(vis, 0, sizeof(vis));
  fill(0);
  memset(dyn, -1, sizeof(dyn));
  int ans = 0;
  for (int lim = 0; lim <= k; lim++) {
    ans += recurse(0, lim, k);
    if (ans >= MOD) ans -= MOD;
  }
  fprintf(out, "%d\n", ans);
  return 0;
}
