Олимпиадный тренинг

Задача 23364. Theater tickets


Задача

Темы:
Not so long ago, the first theater was completed in the city of the future Innopolis. After a hard working week, university students decided to go to the theater. In the morning they arrived at the opening of the theater box office in order to have time to buy tickets. A theater ticket costs 100 rubles.

It turned out that each girl has exactly one banknote of 100 rubles, and each boy — denomination of 1000 rubles. Before the guys, no one had time to buy a ticket, so the box office is empty. This means that the cashier gives change only with the banknotes that he received from other guys who were earlier in the queue. The cashier serves everyone in turn and does not start serving the next person if he has not yet sold the ticket or given the required change to the previous one.

The guys began to line up in such a way that everyone could buy a ticket. While they were thinking about how to create such a queue, the cashier wondered how many ways there are to arrange girls and boys so that everyone can buy a ticket. Help him answer this question.

Ways are considered different if there is such a place in the queue that in one of them there is a girl in this place, and in the other — boy.

Input data format
The first line contains two non-negative integers n and m, where n — number of girls, m — number of boys (1<= n + m < 104).

Output data format
Output the remainder of dividing the number of ways to queue students so that everyone can buy a ticket by 109 + 7.

Enter Output
18 2 10
8 1 0
12 1 4