Under construction

Still being built. Things may change

Beautiful Graph

Time limit2sMemory limit512 MB

Summary
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).
Level

Hard8 of 10

Topics
Graph, Minimum spanning tree, Combinatorics, Dynamic programming
Solved
No attempts yet

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(N−1)/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. (2≤N≤162 \le N \le 16)

Output

Print the answer on the first line.

Examples3

  1. Example 1

    Input
    3
    
    Expected output
    15
    
  2. Example 2

    Input
    2
    
    Expected output
    2
    
  3. Example 3

    Input
    16
    
    Expected output
    682141922