#543. 「Nowcoder多校 2019 Day1」ABBA

「Nowcoder多校 2019 Day1」ABBA

题目描述

Bobo has a string of length 2(n + m) which consists of characters A and B. The string also has a fascinating property: it can be decomposed into (n + m) subsequences of length 2, and among the (n + m) subsequences n of them are AB while other m of them are BA.

Given n and m, find the number of possible strings modulo (109+7) (10^9+7) .

输入格式

The input consists of several test cases and is terminated by end-of-file.

Each test case contains two integers n and m.

  • 0n,m103 0 \leq n, m \leq 10^3
  • There are at most 2019 test cases, and at most 20 of them has max{n,m}>50 \max\{n, m\} > 50 .

输出格式

For each test case, print an integer which denotes the result.

样例

样例输入

1 2
1000 1000
0 0

样例输出

13
436240410
1