Battle of Scundu

Time limit: 0.5s Memory limit: 128MB Input: Output:

In 10660 B.C., we will assume that, in Scundu, there has been the most epic battle to this day (because we can't prove that it didn't happen). The battle between the scundenians (the name of the people from scundu) and the invading forces was very close, so close that it was perfectly even and both sides decided to call for reinforcements. We say that the scundenians won the battle if, in every moment of the battle (since the reinforcements start to arrive), the number of scundenians engaged in battle was greater or equal to the number of invading forces engaged in battle.

Knowing the number NN of scundenians that come as reinforcements, the same NN number of invading forces that come as reinforcements and that at every second there is exactly one soldier arriving at battle (either scundenian or invader), find the number of ways the reinforcements can come so that the scundenians win The Battle of Scundu

We consider that 2 ways of the reinforcements a0a1ana_0 a_1 \dots a_n and b0b1bnb_0 b_1 \dots b_n to come are different if at any second 1in1 \le i \le n we have aibia_i \neq b_i (where aia_i and bib_i represent the type of the soldier that comes at the second ii, scundenian or invader).

Input data

You receive one integer from the console NN (1N1 000 0001 \le N \le 1 \ 000 \ 000), the number of soldiers each side gets as reinforcements.

Output data

You have to print one number xx , the number of ways the scundenians win the Battle of Scundu. Because the number can be very big, you have to output the number modulo 1 000 000 0071 \ 000 \ 000 \ 007.

Constraints and clarifications

  • For 3030 points it is guaranteed that N30N \le 30;
  • For another 3030 points it is guaranteed that N1000N \le 1000;
  • For the last 4040 points, we have N1 000 000N \le 1 \ 000 \ 000.

Example

stdin

3

stdout

5

Explanation

If we represent the reinforcements as a sequence a1,a2,,a2Na_1,a_2, \dots, a_{2N} where ai=Sa_i = S means that at the second ii a scundenian arrived at the battle, while ai=Ia_i = I means that at the second ii an invader arrived at the battle, we can describe the possible ways the reinforcements can come as:

SSSIII
SSISII
SSIISI
SISSII
SISISI

Log in or sign up to be able to send submissions!