Author:  И. Блинов  Time limit:  1 sec  
Input file:  Standard input  Memory limit:  256 Mb  
Output file:  Standard output 
A caterpillar of length L crawls over rough terrain. Rough terrain can be represented as a onedimensional array of N cells with different heights. A cell a_{i} is called a downhill if a_{i} > a_{i + 1}. A cell a_{i} is called an uphill if a_{i} < a_{i + 1}. Initially, the caterpillar occupies the first L cells.
In order to advance one cell, the caterpillar spends 1 second of time. However, if it occupies more downhills than uphills, and the head of the caterpillar is on the downhill, it immediately moves one cell to the right.
Determine after how many seconds the head of the caterpillar reaches the last cell.
The first line of the input file contains two integers L, N. The second line contains N integers a_{i}.
The output must contain one integer — time after which the caterpillar reaches the last cell.
1 ≤ a_{i}, N, L ≤ 10^{6}, L ≤ N, a_{i} ≠ a_{i + 1}
No.  Standard input  Standard output 

1 


2 

