Skyscrapers

No attempts yetTime limit6sMemory limit512 MB

Problem

Skyscrapers is a pencil puzzle. It is played on a square n×nn \times n grid, and every cell of the grid holds a building. Each row and each column of the grid has exactly one building of height 11, one of height 22, and so on up to height nn. Numbers may appear at the beginning and at the end of each row and each column. A number tells how many buildings are visible from that vantage point, where a taller building hides every shorter building behind it. When you solve the puzzle you are given only the numbers along the outside of the grid, and you have to determine the height of the building in every cell.

Take a single row of an n×nn \times n puzzle. If you know how many buildings are visible from the left of the row and how many are visible from the right, how many ways are there to fill that row with buildings of heights 11 through nn?

Input

The input holds several test cases. Each test case is one line with three integers: nn (1n50001 \le n \le 5000), left\text{left} (1leftn1 \le \text{left} \le n), and right\text{right} (1rightn1 \le \text{right} \le n). Here nn is the size of the row, and left\text{left} and right\text{right} are the number of buildings visible from the left and from the right. The input ends with a line holding three 0s.

Output

For each test case, print a single integer, the number of arrangements that satisfy the constraints, modulo 1,000,000,007. That is not a misprint, the last digit is a seven. Print no extra spaces, and do not separate answers with blank lines.