#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) #define all(x) x.begin(),x.end() #define int long long int N,K; vector G[101010]; const i64 MOD = 1e9 + 7; vector dfs(int v,int f = -1){ vector res; res.push_back(1); for(int to : G[v]){ if(to == f) continue; vector ret = dfs(to,v); vector next(res.size() + ret.size() - 1,0); for(int i = 0;i < res.size();i++){ for(int j = 0;j < ret.size();j++){ (next[i + j] += res[i] * ret[j] % MOD) %= MOD; } } res = next; } res.push_back(1); return res; } signed main(){ 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)[K] % MOD << endl; }