L. Count the Christmas Trees
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

The New Year is coming soon! To celebrate, Matvey decided to buy himself a Christmas tree. He went to a store where graph-trees are sold. However, when he arrived, he couldn't decide because there was a huge selection. Then he decided to count how many Christmas trees of height $$$n$$$ exist.

Matvey considers a tree with a root at vertex 1 to be a Christmas tree of height $$$n$$$ if it satisfies the following conditions:

  • let's assume that the root is on the first layer, its children are on the second layer, and so on, the children of the vertex on the $$$i$$$-th layer are on the $$$(i+1)$$$-th layer. Then there must be exactly $$$i$$$ vertices on the $$$i$$$-th layer;
  • each vertex has no more than two children;
  • number the vertices by layers from top to bottom with integers, starting with 1. On one layer, number the vertices from left to right. After that, consider two vertices $$$u$$$, $$$v$$$, such that they are on the same layer and $$$u \lt v$$$, then all children of vertex $$$u$$$, if any, must have a smaller number than the children of vertex $$$v$$$.

Matvey considers Christmas trees to be different if there are numbers $$$i$$$, $$$j$$$, such that one tree has an edge between vertices $$$i$$$ and $$$j$$$, and the other tree does not have such an edge.

For height $$$3$$$, there are two different Christmas trees, which are shown in the figure.

You need to calculate the number of different Christmas trees of height $$$n$$$.

Input

The first line contains one number $$$n$$$ — the depth of the Christmas tree ($$$1 \le n \le 5000$$$).

Output

In a single line, output one number — the number of Christmas trees of depth $$$n$$$.

Since the answer can be very large, output it modulo $$$10^9 + 7$$$.

Examples
Input
3
Output
2
Input
4
Output
12