J. Bugcat's Mahjong
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

During the Lunar New Year, Bugcat has been playing a Mahjong-themed "roguelike" game (similar to Balatro). In this game, Bugcat draws tiles from a deck and discards them, and it has perfect knowledge of the tile sequence in the "wall" (the deck).

Bugcat starts wondering: if there is a Mahjong set with $$$n$$$ distinct types of tiles, what is the expected number of tiles drawn (including the initial $$$13$$$ tiles) to complete a "Four Concealed Pongs" (Sūankō) hand, assuming optimal play? Output the result modulo $$$10^9 + 7$$$.

Definitions:

  • The Mahjong set: There are $$$n$$$ types of tiles. Each type has exactly $$$4$$$ identical-looking but distinct tiles. Thus, there are a total of $$$4n$$$ tiles in the deck.
  • Four Concealed Pongs: A "Pong" (or triplet) is defined as $$$3$$$ tiles of the same type. To complete this hand, you need four Pongs and one pair ($$$2$$$ tiles of the same type).

Simplified Problem Statement:

There are $$$4n$$$ tiles, categorized into $$$n$$$ colors (types), with $$$4$$$ tiles per color. Even tiles of the same color are considered distinct.

Consider all $$$(4n)!$$$ possible permutations of the deck. For a given permutation, let the "cost" be the smallest index $$$i$$$ such that among the first $$$i$$$ tiles in the sequence, the following two conditions are met:

  • At least $$$4$$$ colors have appeared $$$3$$$ or more times.
  • At least $$$5$$$ colors have appeared $$$2$$$ or more times.

Find the expected value of the cost $$$i$$$ over all possible permutations. Output the result modulo $$$10^9 + 7$$$.

Input

A single integer $$$n$$$ ($$$1 \le n \le 2 \times 10^6$$$), representing the number of tile types.

Output

A single integer representing the expected cost modulo $$$10^9 + 7$$$.

Examples
Input
5
Output
80495372
Input
4
Output
0