#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (!b)
    return a;
  else
    return gcd(b, a % b);
}
int n, k;
vector<vector<int>> adj(100000);
vector<vector<long long int>> dp(1000, vector<long long int>(1000));
void inline mod(long long int &x) {
  if (x >= (long long int)(1e9 + 7)) x -= (long long int)(1e9 + 7);
}
void dfs(int v, int u) {
  dp[v][0] = dp[v][k + 1] = 1;
  for (int x : adj[v]) {
    if (x == u) continue;
    dfs(x, v);
    vector<long long int> ndp(1000);
    for (int i = 0; i <= 2 * k; i++) {
      for (int j = 0; j <= 2 * k; j++) {
        if (i <= k && j <= k) {
          ndp[min(i, j + 1)] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
          mod(ndp[min(i, j + 1)]);
        }
        if (i > k && j > k) {
          ndp[max(i, j + 1)] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
          mod(ndp[max(i, j + 1)]);
        }
        if (i <= k && j > k) {
          if (i + j - k <= k) {
            ndp[i] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
            mod(ndp[i]);
          } else {
            ndp[j + 1] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
            mod(ndp[j + 1]);
          }
        }
        if (i > k && j <= k) {
          if (i - k + j <= k) {
            ndp[j + 1] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
            mod(ndp[j + 1]);
          } else {
            ndp[i] += dp[v][i] * dp[x][j] % (long long int)(1e9 + 7);
            mod(ndp[i]);
          }
        }
      }
    }
    dp[v] = ndp;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int v, u;
    cin >> v >> u;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  long long int ans = 0;
  dfs(1, 0);
  for (int i = 0; i <= k; i++) {
    ans += dp[1][i];
    mod(ans);
  }
  cout << ans << '\n';
}
