#include <bits/stdc++.h>
using namespace std;
const int MaxN = 107;
const int MaxM = 50;
const int mod = (int)1e9 + 7;
int N, M, MM;
vector<int> iv[MaxN];
long long S, f[MaxN][MaxM], tmp[MaxM];
void DFS(int x, int fa) {
  int i, j, k, u;
  f[x][0] = 1;
  f[x][M + 1] = 1;
  for (i = 0; i < iv[x].size(); i++)
    if (iv[x][i] != fa) {
      u = iv[x][i];
      DFS(u, x);
      for (j = 0; j <= MM; j++) tmp[j] = 0;
      for (j = 0; j <= MM; j++)
        for (k = 0; k < MM; k++)
          if (j + k <= M + M)
            (tmp[min(j, k + 1)] += f[x][j] * f[u][k]) %= mod;
          else
            (tmp[max(j, k + 1)] += f[x][j] * f[u][k]) %= mod;
      for (j = 0; j <= MM; j++) f[x][j] = tmp[j];
    }
}
int main() {
  int i, u, v;
  scanf("%d%d", &N, &M);
  MM = M + M + 1;
  for (i = 1; i < N; i++) {
    scanf("%d%d", &u, &v);
    iv[u].push_back(v);
    iv[v].push_back(u);
  }
  DFS(1, 0);
  for (i = 0; i <= M; i++) S = (S + f[1][i]) % mod;
  printf("%I64d\n", S);
  return 0;
}
