Being an expert, you know that by definition a bonsai tree consists of a single branch, with 0 or more smaller bonsai trees branching off from that branch.
figure 1: Four distinct examples of bonsai trees.
The height and weight of a bonsai tree can be carefully determined. A tree’s weight is equal to the number of branches that appear in it. The weights of the trees in figure 1 are 1, 4,6 and 6, respectively. A tree’s height is equal to the length of the longest chain of branches from the root to the top of the tree. The heights of the trees in figure 1 are 1, 2, 3 and 3,respectively.To make the most use of your window, you want to produce a bonsai tree of the precise height and weight that it can support. To get an idea of the number of options available to you, you would like to know how many different trees you could possibly grow for your store. Given a height and a weight, can you determine the number of trees with exactly that height and weight? Because the number may be very large, you may give your answer modulo 1,000,000,007.