#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const long long int INF = 123456789987654321;
const long long int mod = 1000000007;
int N, K;
vector<vector<int> > adj, chd;
vector<int> height;
void dfs(int now, int bf) {
  height[now] = 0;
  for (int i = 0; i < adj[now].size(); i++) {
    int nxt = adj[now][i];
    if (nxt == bf) continue;
    dfs(nxt, now);
    chd[now].push_back(nxt);
    height[now] = max(height[now], height[nxt] + 1);
  }
}
vector<vector<vector<long long int> > > cache;
long long int dp(int u, int dist, int bdist) {
  if (dist > K) return 0;
  if (bdist == 2 * K + 2) {
    if (height[u] + dist <= K)
      return 1;
    else
      return 0;
  }
  long long int& ret = cache[u][dist][bdist];
  if (ret != -1) return ret;
  if (chd[u].size() == 0) {
    if (bdist == 0) return ret = 1;
    return ret = 0;
  }
  if (bdist == 0) {
    ret = 0;
    for (int i = 1; i <= 2 * K + 2; i++) {
      ret += dp(u, 0, i);
      ret %= mod;
    }
    return ret;
  }
  long long int t = 1;
  for (int i = 0; i < chd[u].size(); i++) {
    int v = chd[u][i];
    long long int tmp = 0;
    for (int j = bdist - 1; j <= 2 * K + 2; j++) {
      tmp += dp(v, min(min(dist + 1, bdist + 1), j), j);
      tmp %= mod;
    }
    t *= tmp;
    t %= mod;
  }
  long long int t2 = 1;
  for (int i = 0; i < chd[u].size(); i++) {
    int v = chd[u][i];
    long long int tmp = 0;
    for (int j = bdist; j <= 2 * K + 2; j++) {
      tmp += dp(v, min(min(dist + 1, bdist + 1), j), j);
      tmp %= mod;
    }
    t2 *= tmp;
    t2 %= mod;
  }
  ret = (t + mod - t2) % mod;
  return ret;
}
int main() {
  scanf("%d %d", &N, &K);
  adj.resize(N);
  for (int i = 0; i < N - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  chd.resize(N);
  height.resize(N);
  dfs(0, -1);
  cache = vector<vector<vector<long long int> > >(
      N, vector<vector<long long int> >(K + 1,
                                        vector<long long int>(2 * K + 2, -1)));
  long long int ans = 0;
  for (int i = 0; i <= 2 * K + 2; i++) {
    ans += dp(0, i, i);
    ans %= mod;
  }
  printf("%I64d", ans);
}
