Booming Business

Count ordered rooted trees with exactly w nodes and height exactly h, modulo 1e9+7, where children of each node are an ordered sequence.

Hard8Dynamic programmingCombinatoricsTreeRecursionNo attempts yetTime limit2sMemory limit512 MB

Problem

Bonsai is the art of growing small trees in small containers. You are an expert at it, and every year you win the Bonsai Association's pruning competition. You recently rented a small store to sell your creations, and now you need a window display that draws in customers. You want the most impressive tree that fits the window, but the window is only so tall and the floor of the display can only bear so much weight, so you need a tree of exactly the right height and weight.

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 bonsai trees.

The weight of a bonsai tree is the number of branches in it. The weights of the trees in Figure 1 are 1, 4, 6 and 6. The height of a bonsai tree is the length of the longest chain of branches from the root to the top. The heights of the trees in Figure 1 are 1, 2, 3 and 3.

The smaller trees branching off one branch are ordered from left to right. Two bonsai trees count as the same tree only when every branch carries the same smaller trees in the same order.

Given hh and ww, count the bonsai trees whose height is exactly hh and whose weight is exactly ww. The count can be very large, so print it modulo 109+710^9 + 7.

Input

One line with two integers hh and ww separated by a space (1h,w3001 \le h, w \le 300).

Output

Print one line with the number of bonsai trees of height hh and weight ww, modulo 109+710^9 + 7.