#include using namespace std; const int md = 1e9 + 7; inline void add(int &a, int b) { a += b; if (a >= md) a -= md; } inline int mul(int a, int b) { return (int)((long long)a * b % md); } vector> grh, dp; vector dsc; void dfs (int crr, int prt) { dp[crr][0] = 1; for (int nxt : grh[crr]) if (nxt != prt) { dfs(nxt, crr); for (int i = dsc[crr]; i >= 0; i--) { for (int j = 1; j <= dsc[nxt]; j++) { add(dp[crr][i + j], mul(dp[crr][i], dp[nxt][j])); } } dsc[crr] += dsc[nxt]; } dsc[crr]++; dp[crr][dsc[crr]] = 1; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; grh.resize(n); for (int i = 0; i < n - 1; i++) { int a, b; cin >> a >> b; grh[a].push_back(b); grh[b].push_back(a); } dp.resize(n, vector(n + 1, 0)); dsc.resize(n, 0); dfs(0, 0); cout << dp[0][k] << '\n'; return 0; }