問題一覧 > 通常問題

No.727 Broker moko

レベル : / AI推定難易度 : 1325 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 216 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 87
作問者 : moko_freedom / テスター : square1001
お気に入りにしたユーザー ProblemId : 2249 / 自分の提出
問題文最終更新日: 2018-08-27 17:36:13
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 198 (順位表) の他の問題:

Problem Statement

moko is a broker in a certain country. Their job is to act as an intermediary between people who want to sell goods and people who want to buy goods.

Today, $2N$ people plan to buy or sell goods through moko; half of them want to sell goods, and the other half want to buy goods.


moko takes goods from people who come to sell, keeps them until a person who wants to buy comes, and hands them over to the person who came to buy.

A person who wants to sell comes to sell the item they intend to sell, whereas a person who wants to buy chooses one item at random from the items moko holds at the time they come, and buys it.
Each person who wants to sell sells exactly once, and the items differ from one seller to another.

Also, people who want to sell can visit moko at any time, but people who want to buy visit only when moko holds at least one item.

To get a clear outlook on the work, moko wants to know the number of possible combinations of "the flow of goods transactions", and has asked you, a professional of competitive programming, for help.

On behalf of moko, find the number of combinations of "the flow of goods transactions", modulo 1000000007.

Input

$N$

$1 \le N \le 10^6$

Output

Output the answer on one line. Also, print a newline at the end.

Sample

Sample 1
Input
1
Output
1

There is 1 person who wants to sell and 1 person who wants to buy.
Since the person who wants to buy can come only after the person who wants to sell has handed the item over to moko,
the only possibility is seller -> buyer,
which gives 1 way.

Sample 2
Input
2
Output
12

Representing people who want to sell as ○, people who want to buy as △, and goods as □, the situation is as shown in the figure above.
The numbers inside ○ and △ distinguish the people who want to sell or buy. The number in □ is the item number. Time flows from left to right in the image.

Sample 3
Input
1333
Output
871035815

Note that you must output the answer modulo 1000000007.

Sample 4
Input
28880
Output
593741191

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。