#include #define rep(i, n) for (int (i) = 0; (i) < (int)(n); (i)++) const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; const int MAXN = 2222; const ll MOD = 1e9+7; vector G[MAXN]; ll dp[MAXN][MAXN]; vll dfs(int v, int p) { vll ret(1, 1); for (int next : G[v]) { if (next == p) continue; vll tmp = dfs(next, v); int n = ret.size(); int m = tmp.size(); vll nret(n+m-1); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) { (nret[i+j] += ret[i]*tmp[j]) %= MOD; } ret = nret; } ret.push_back(1); return ret; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N, K; cin >> N >> K; for (int i = 0; i < N-1; i++) { int a, b; cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } cout << dfs(0, -1)[K] << endl; return 0; }