import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,K = MI() Graph = [[] for _ in range(N)] for _ in range(N-1): a,b = MI() Graph[a].append(b) Graph[b].append(a) mod = 10**9+7 def DP(u,par): dp = [1,1] # dp[i] = 頂点uを根とする部分木において、丁度i個の頂点が黒に塗られている様な塗り方 for v in Graph[u]: if v == par: continue dp_v = DP(v,u) a = len(dp) b = len(dp_v) new_dp = [0]*(a+b-1) for i in range(a): for j in range(b): if i != a-1: new_dp[i+j] += dp[i]*dp_v[j] new_dp[i+j] %= mod new_dp[-1] = 1 dp = new_dp return dp ans = DP(0,-1)[K] print(ans)