N,K = map(int,input().split()) G = [[] for _ in range(N)] for _ in range(N-1): u,v = map(int,input().split()) G[u].append(v) G[v].append(u) visited = [0]*N size = [0]*N dp = [[] for _ in range(N)] #dp[v][k]:vの部分木でk個黒が塗られている数 MOD = 10**9+7 def dfs(cur): visited[cur] = 1 size[cur] = 1 dp_cur = [1] for nxt in G[cur]: if visited[nxt]: continue dfs(nxt) dp_nxt = dp[nxt] ndp = [0]*(size[cur]+size[nxt]-1) for i in range(size[cur]): for j in range(size[nxt]): ndp[i+j] += dp_cur[i]*dp_nxt[j] ndp[i+j] %= MOD dp_cur = ndp size[cur] += (size[nxt]-1) dp_cur.append(1) size[cur] += 1 dp[cur] = dp_cur dfs(0) print(dp[0][K]) #print(dp)