n,k=map(int,input().split()) if n==k: print(1) exit() e=[[] for i in range(n)] for i in range(n-1): a,b=map(int,input().split()) e[a]+=[b] e[b]+=[a] M=10**9+7 v=[0]*n w=[[] for i in range(n)] u=[0]*n q=[0] while len(q)>0: s=q[-1] if v[s]==0: v[s]=1 q+=[t for t in e[s] if v[t]==0] else: u[s]=1 w[s]=[0] w[s][0]=1 for t in e[s]: if v[t]==0: w[t]+=[1] nw=[0]*(u[s]+u[t]) for i in range(u[s]): for j in range(u[t]+1): nw[i+j]+=w[s][i]*w[t][j] nw[i+j]%=M w[s]=nw u[s]+=u[t] v[s]=0 q.pop() print(w[0][k])