#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
vector<int> tr[105];
int dp[105][25][105];
int K;
int sol(int i, int p, int up, int down) {
  if (min(up, down) > K) return 0;
  if (dp[i][up][down] != -1) return dp[i][up][down];
  if (down == 0) {
    int ans = 0;
    int res = 1;
    for (int j = 0; j < tr[i].size(); j++)
      if (tr[i][j] != p) {
        ans = 0;
        for (int k = 0; k <= 101; k++) {
          ans += sol(tr[i][j], i, 1, k);
          ans %= mod;
        }
        res = (res * 1ll * ans) % mod;
      }
    return dp[i][up][down] = res;
  }
  if (down == 101) {
    int ok = 1;
    for (int j = 0; j < tr[i].size(); j++)
      if (tr[i][j] != p) ok *= sol(tr[i][j], i, min(K + 1, up + 1), down);
    return dp[i][up][down] = ok;
  }
  int ans = 0;
  int res = 1;
  int cnt = 0;
  vector<int> pre;
  vector<int> each;
  for (int j = 0; j < tr[i].size(); j++)
    if (tr[i][j] != p) {
      cnt++;
      ans = 0;
      for (int k = down; k <= 101; k++) {
        ans += sol(tr[i][j], i, min(down + 1, min(K + 1, up + 1)), k);
        ans %= mod;
      }
      each.push_back(ans);
      res = (res * 1ll * ans) % mod;
      pre.push_back(res);
    } else {
      each.push_back(1);
      pre.push_back(res);
    }
  int right = 1;
  int ANS = 0;
  for (int j = tr[i].size() - 1; j >= 0; j--) {
    if (tr[i][j] == p) continue;
    int cur = sol(tr[i][j], i, min(down - 1, min(K + 1, up + 1)), down - 1);
    ans = each[j] + cur;
    ans %= mod;
    int left = 1;
    if (j > 0) left = pre[j - 1];
    int add = (left * 1ll * cur) % mod;
    add = (add * 1ll * right) % mod;
    ANS += add;
    ANS %= mod;
    right = (right * 1ll * ans) % mod;
  }
  return dp[i][up][down] = ANS;
}
int main() {
  memset(dp, -1, sizeof(dp));
  int n;
  scanf("%d %d", &n, &K);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    tr[u].push_back(v);
    tr[v].push_back(u);
  }
  int ans = 0;
  for (int i = 0; i <= K; i++) {
    ans += sol(0, 0, 21, i);
    ans %= mod;
  }
  printf("%d\n", ans);
  return 0;
}
