There is a permutation $A=(A_1,A_2,\dots,A_N)$ of the integers from $1$ to $N$. Initially, we have $A_i=i\ (1\leq i \leq N)$.
Takahashi will perform the following operation on this sequence $K$ times.
* Choose an integer $k$ such that $0 \leq k < N$. Take the last $k$ terms of $A$ and insert them among the first $N-k$. More precisely, replace $A$ with any permutation $A'$ of the $N$ integers that satisfies the following conditions.
* $(A_1,A_2,\dots,A_{N-k})$ is a (not necessarily contiguous) subsequence of $A'$.
* $(A_{N-k+1},A_{N-k+2},\dots,A_{N})$ is a (not necessarily contiguous) subsequence of $A'$.
The cost of the series of operations is $\sum_{i=1}^{K}k_iC_i$, where $k_i$ is the $k$ chosen in the $i$\-th operation.
Takahashi wants to perform $K$ operations so that $A=(P_1,P_2,\dots,P_N)$ afterward.
Determine whether it is possible to perform such a series of operations. If it is possible, find its minimum cost.
## Constraints
* $2 \leq N \leq 100$
* $1 \leq K \leq 100$
* $1 \leq C_i \leq 10^9$
* $(P_1,P_2,\dots,P_N)$ is a permutation of the integers from $1$ to $N$.
* All input values are integers.
## Input
The input is given from Standard Input in the following format:
$N$ $K$
$C_1$ $C_2$ $\dots$ $C_K$
$P_1$ $P_2$ $\dots$ $P_N$
[samples]