cswork / OAOpen practice workspace

IBMOA #1

Drawing Edges

Estimated EasyJudge-ready

Topics (AI-labelled)Bits & Math

n labeled vertices form an undirected simple graph with no self-loops and no multiple edges; the graph may be disconnected. Find the number of distinct graphs modulo 1000000007.

Input

One line containing n. On this site 1≤n≤10^9.

Output

Output one integer, the answer.

Example 1

Input:

4

Output:

64

Example 2

Input:

1

Output:

1

Example 3

Input:

3

Output:

8

Example notes

The examples give 64, 1 and 8 respectively; with one vertex, only the edgeless graph exists.

Editorial

Loading solution…