The first line contains two integers(
) and
(
).
The next line containsintegers, the
-th one means
(
).
If it's impossible to construct, output
. Otherwise output the minimum number of inversions in
.
For the second sample,. The circle
satisfies the condition.