#include <bits/stdc++.h>
using namespace std;
vector<vector<vector<long long> > > dp;
vector<vector<long long> > g;
vector<long long> sum;
long long n;
int k;
const long long mod = 1e9 + 7;
void dfs(long long v, long long pr) {
  dp[v][0][k] = 1;
  long long x = 1;
  for (int z = 0; z < g[v].size(); ++z) {
    long long num = g[v][z];
    if (num != pr) {
      dfs(num, v);
      x = (x * sum[num]) % mod;
      vector<vector<long long> > temp(k + 1, vector<long long>(k + 1, 0));
      for (int i = 0; i <= k; ++i) {
        for (int j = 0; j <= k; ++j) {
          for (int a = 0; a <= k; ++a) {
            if (a == k - 1) continue;
            for (int b = 0; b <= k; ++b) {
              long long new_j = min(j, b + 1);
              long long new_i = min(max(i, a + 1), k);
              if (i == k)
                new_i = (a == k ? k : a + 1);
              else if (a == k)
                new_i = i;
              if (b == k - 1 && i == 0 && a == k) new_i = k;
              if (new_j + new_i <= k && new_j < k) new_i = k;
              temp[new_i][new_j] =
                  (temp[new_i][new_j] + dp[v][i][j] * dp[num][a][b]) % mod;
            }
          }
        }
      }
      dp[v] = temp;
    }
  }
  dp[v][k][0] = x;
  sum[v] = 0;
  for (long long i = 0; i <= k; ++i) {
    for (long long j = 0; j <= k; ++j) sum[v] = (sum[v] + dp[v][i][j]) % mod;
  }
}
int main() {
  cin >> n >> k;
  dp.resize(n, vector<vector<long long> >(k + 1, vector<long long>(k + 1, 0)));
  g.resize(n);
  sum.resize(n);
  for (long long i = 0; i < n - 1; ++i) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, 0);
  long long ans = 0;
  for (long long i = 0; i <= k; ++i) {
    ans = (ans + dp[0][k][i]) % mod;
  }
  cout << ans;
}
