Plane trees and oaks#12329

Plane trees and oaks

1 second
128 megabytes
Hard

In Baku, it was decided to landscape a new park. The park has distinct spots, and in each spot, it is possible to plant either a plane tree or an oak.

The city administration wants all the trees to be connected by paths in such a way that it is possible to go from any tree to any other tree. At the same time, to save the budget, the number of paths should be minimal, sufficient to make all the trees connected.

Due to city regulations:

Additionally, each tree is distinguishable — that is, each plane tree and each oak is considered unique, as is each spot.

How many ways are there to plant the trees and construct paths between them while following the city regulations? Since the number of ways can be very large, output it modulo 10^9 + 7.

Input

The input contains up to lines. Each line contains a single integer n~(2 \le n \le 2 \cdot 10^5) — the number of spots in the park that must be filled with trees.

Output

For each test, print the number of ways to plant the trees and construct paths in accordance with the city regulations, modulo 10^9 + 7.

Examples

Example 1

Loading
Loading