No.727 Broker moko
タグ : / 解いたユーザー数 87
作問者 :
moko_freedom
/ テスター :
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もしくは右上の雲マークをクリックしてアカウントを作成してください。