Some parenthesizations

Given a natural number nn, compute the number of correct parenthesizations with nn opening and nn closing parentheses, with just one restriction: the substring “)()” is not allowed.

For instance, for n=4n = 4 there are four correct parenthesizations: “(((())))”, “(()(()))”, “(())(())” and “()((()))”.

Input

Input consists of several cases, each one with an nn between 1 and 10410^4.

Output

For each nn, print the result modulo 109+710^9 + 7.

Problem information

Author: Xavier Povill

Generation: 2026-01-25T10:12:31.825Z

© Jutge.org, 2006–2026.
https://jutge.org