import sys sys.setrecursionlimit(2000) input=sys.stdin.readline mod=10**9+7 n,c=map(int,input().split()) minc=min(n*6-6,c) edge=[[]for _ in range(n)] for _ in range(n-1): a,b=map(int,input().split()) a-=1 b-=1 edge[a].append(b) edge[b].append(a) dp=[minc*[1]for _ in range(n)] def dfs(r,node): for mode in edge[node]: if r==mode:continue dpsub=dfs(node,mode) for i in range(minc): f=0 if i>2:f+=dpsub[i-3] if i