import sys sys.setrecursionlimit(4000) def read_data(): N, K = map(int, input().split()) Es = [[] for i in range(N)] for i in range(N - 1): a, b = map(int, input().split()) Es[a].append(b) Es[b].append(a) return N, K, Es def solve(N, K, Es): if K == 0: return 1 if N == K: return 1 root = 0 parent = -1 lst = f(root, parent, Es) lst.append(1) return lst[K] def f(node, parent, Es): if node and len(Es[node]) == 1: return [1, 1] lst = [1] for child in Es[node]: if child == parent: continue lst_c = f(child, node, Es) lst = merge(lst, lst_c) lst.append(1) return lst def merge(lst1, lst2): mod = 10**9 + 7 lst = [0] * (len(lst1) + len(lst2) - 1) for i, vi in enumerate(lst1): for j, vj in enumerate(lst2): lst[i + j] += vi * vj return [v % mod for v in lst] N, K, Es = read_data() print(solve(N, K, Es))