import sys sys.setrecursionlimit(4000) def f(v,p,E): if v and len(E[v])==1: return [1,1] L=[1] for c in E[v]: if c==p: continue L=m(L,f(c,v,E)) L.append(1) return L def m(L1, L2): M=10**9+7 L=[0]*(len(L1)+len(L2)-1) for i,a in enumerate(L1): for j,b in enumerate(L2): L[i+j]+=a*b return [v%M for v in L] N,K=map(int,input().split()) E=[[] for i in range(N)] for i in range(N-1): a,b=map(int,input().split()) E[a].append(b) E[b].append(a) L=f(0,-1,E) L.append(1) print(L[K])