404458: GYM101510 D Drama
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
D. Dramatime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output
Vera has a grid with H rows and N columns. Rows are numbered 1 to H and columns are numbered 1 to N. Let the cell in the r-th row and c-th column be (r, c). Cells are coloured white or black. A colouring is a pyramid if:
- Exactly N cells are black.
- (1, 1) is black.
- If (r, a) and (r, b) are black, then (r, k) is black for a < k < b.
- If (r, c) is black, then (r - 1, c), if it exists, is black.
- If (r, c) is black and there is no k < c such that (r, k) is black, then (r + 1, c), if it exists, is white.
Two pyramids are different if there is a cell that is white in one pyramid and black in the other. Compute the number of different pyramids modulo 109 + 7.
InputLine 1 contains integers H and N (1 ≤ H, N ≤ 105).
OutputPrint one line with one integer, the number of different pyramids modulo 109 + 7.
ExamplesInput2 6Output
7Input
3 20Output
487Note
For the first example, the seven pyramids are:
###### ####.. ####.. #####. #####. #####. #####.
...... .##... ..##.. .#.... ..#... ...#.. ....#.