LearnPy Hub
← Arena
IntermediateRating 1400

Grid Paths Mod

Count right/down paths through an r×c grid of cells (from the top-left cell to the bottom-right cell), mod 1 000 000 007.

Input

r c (≤ 10⁵).

Output

A count.

Sample 1

Input
2 2
Output
2

Sample 2

Input
3 7
Output
28
solution.py
Output appears here
Grid Paths Mod · Python Arena problem · LearnPy Hub