There are $N$ trees standing in a row from left to right. The $i$\-th tree $(1 \leq i \leq N)$ from the left, Tree $i$, has the height of $H_i$.
You will now cut down all these $N$ trees in some order you like. Formally, you will choose a permutation $P$ of $(1, 2, \ldots, N)$ and do the operation below for each $i=1, 2, 3, ..., N$ in this order.
* Cut down Tree $P_i$, that is, set $H_{P_i}$ to $0$, at a cost of $H_{P_i-1}+H_{P_i}+H_{P_i+1}$.
Here, we assume $H_0=0,H_{N+1}=0$.
In other words, the cost of cutting down a tree is the total height of the tree and the neighboring trees just before doing so.
Find the number of permutations $P$ that minimize the total cost of cutting down the trees. Since the count may be enormous, print it modulo $(10^9+7)$.
## Constraints
* $1 \leq N \leq 4000$
* $1 \leq H_i \leq 10^9$
* All values in input are integers.
## Input
Input is given from Standard Input in the following format:
$N$
$H_1$ $H_2$ $\ldots$ $H_N$
[samples]