Beautiful Graph

Over all complete graphs on N vertices whose edges cost 1 or 2, sum the number of minimum spanning trees that are paths (every degree at most 2).

Hard8GraphMinimum spanning treeCombinatoricsDynamic programmingNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given an integer NN.

A complete graph has exactly one undirected edge between every pair of distinct vertices.

A graph is beautiful when it meets both conditions below.

  • It is a complete graph on NN vertices.
  • Every edge has cost 11 or cost 22.

So there are 2N(N1)/22^{N(N-1)/2} beautiful graphs.

A minimum spanning tree (MST) of a beautiful graph GG is a subgraph that meets these conditions.

  • It contains all NN vertices of GG.
  • It is connected, so a path joins every pair of its vertices.
  • The sum of the costs of its edges is minimum.

One beautiful graph can have several MSTs. Their costs are all equal.

An MST is a line when every vertex in it has degree at most 22.

Let f(G)f(G) be the number of MSTs of a beautiful graph GG that are lines.

Print the sum of f(G)f(G) over all beautiful graphs GG on NN vertices, modulo 1,000,000,007.

Input

The first line contains NN. (2N162 \le N \le 16)

Output

Print the answer on the first line.