import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N,K = map(int,readline().split()) m = map(int,read().split()) AB = zip(m,m) MOD = 10 ** 9 + 7 graph = [[] for _ in range(N+1)] for a,b in AB: a+=1; b+=1 graph[a].append(b) graph[b].append(a) root = 1 parent = [0] * (N+1) order = [] stack = [root] while stack: x = stack.pop() order.append(x) for y in graph[x]: if y == parent[x]: continue parent[y] = x stack.append(y) size = [1] * (N+1) # 部分木の大きさ for v in order[::-1]: p = parent[v] size[p] += size[v] def convolve(A,B): LA = len(A); LB = len(B) if LA > LB: A,B = B,A LA,LB = LB,LA C = np.zeros(LA+LB-1,np.int64) for i,x in enumerate(A): C[i:i+LB] += A[i] * B % MOD C %= MOD return C dp = [np.array([1],np.int64) for _ in range(N+1)] for v in order[::-1]: p = parent[v] dp[v] = np.append(dp[v],1) dp[p] = convolve(dp[p], dp[v]) answer = dp[root][K] print(answer)