Misc [I]


Miscellaneous [I]

You want to know how many ways you can organise nn ( and ) brackets so the result string is balanced, that is, so that every closing ) bracket is preceded by an accompanying opening ( bracket somewhere earlier in the string.

Examples of all valid organisations with n=3n=3:

  • ((()))
  • ()()()
  • (())()
  • ()(())
  • (()())

Examples of invalid organisations with n=3n=3:

  • ())(()
  • )()()(
  • (()))(

Input

Input will consist of a single integer nn, representing the number of open and closed brackets we want to organise

Output

Output should be a single integer, representing the number of unique strings of balanced parenthesis of length nn. Since this number could be quite large, output the answer modulo 109+710^9+7

Constraints

  • 1n10001 \leq n \leq 1000

Example

Input 1
3
Output 1
5
Input 2
10
Output 2
16796

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.