Queue Problem

5

1 votes
Easy-Medium
Problem

Students are waiting in the queue to buy the movie ticket. You have to find the number of arrangements of queue such that no. of boys is always greater than no. of girls at any position.

For example: BBBGG, BBGBG are valid arrangements while BGBBG, BBGGB are invalid arrangements in which B denotes a Boy and G denotes a Girl.

Note that every person is considered as a distinct person. Therefore, B1B2G1B3G2 and B1B3G1B2G2 are considered as distinct arrangements.

Input

The first line contains the integer n and m denoting the number of boys and the number of girls respectively.

Output

Print the number of possible arrangements satisfying the above conditions.

Constraints

0 < n < 12

0 < m < 12

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

The possible arrangements are of the types BBBGG and BBGBG and their permutation.

Editor Image

?