Problem

Given a permutation of length $ N $ $ P = \\ {P_1, P_2, \ ldots, P_N \\} $ and the integer $ K $.
Determine if the permutation $ P $ can be monotonically increased by repeating the following operation any number of times $ 0 $ or more.

* Choose the integer $ x \ (0 \ le x \ le N-K) $. Patrol right shift around $ P_ {x + 1}, \ ldots, P_ {x + K} $



However, the cyclic right shift of the subsequence $ U = U_1, \ ldots, U_M $ means that $ U = U_1, \ ldots, U_M $ is changed to $ U = U_M, U_1, \ ldots, U_ {M-1} $. Means to change.

Constraints

The input satisfies the following conditions.

* $ 2 \ leq K \ leq N \ leq 10 ^ 5 $
* $ 1 \ leq P_i \ leq N \ (1 \ leq i \ leq N) $
* $ P_i \ neq P_j \ (i \ neq j) $
* All inputs are integers

Input

The input is given in the following format.


$ N $ $ K $
$ P_1 $ $ \ ldots $ $ P_N $


Permutation length $ N $ and integer $ K $ are given in the first row, separated by blanks.
The elements of the permutation $ P $ are given in the second row, separated by blanks.

Output

Print "Yes" if you can monotonically increase $ P $, otherwise print "No" on the $ 1 $ line.

Examples

Input

3 3
2 3 1


Output

Yes


Input

3 2
1 2 3


Output

Yes


Input

3 3
3 2 1


Output

No
#include <bits/stdc++.h>

using namespace std;
//1-indexed
#include<vector>
template<typename T>
struct BIT{
	int n;
	vector<T>bit;
	BIT(int n_=0):n(n_),bit(n_+1){}
	T sum(int i)
	{
		T ans=0;
		for(;i>0;i-=i&-i)ans+=bit[i];
		return ans;
	}
	void add(int i,T a)
	{
		if(i==0)return;
		for(;i<=n;i+=i&-i)bit[i]+=a;
	}
	int lower_bound(T k)//k<=sum(ret)
	{
		if(k<=0)return 0;
		int ret=0,i=1;
		while((i<<1)<=n)i<<=1;
		for(;i;i>>=1)
			if(ret+i<=n&&bit[ret+i]<k)k-=bit[ret+=i];
		return ret+1;
	}
};
int main(){
    unsigned long N, K;
    cin >> N >> K;
    if(N == K){
        vector<unsigned long> P(N);
        for(auto& i : P)cin >> i;
        P.push_back(P[0]);
        for(unsigned long i = 0; i < N; ++i)if((P[i] + 1 + N - P[i + 1]) % N)return 0 & puts("No");
		puts("Yes");
		return 0;
    }
    if(~K & 1)return 0 & puts("Yes");
    vector<unsigned long> P(N);
    for(auto& i : P)cin >> i;
    BIT<int>bit(N);
	long long T=0;
	for(int i=0;i<N;i++)
	{
		T+=i-bit.sum(P[i]);
		bit.add(P[i],1);
	}
	cout<<(T%2?"No":"Yes")<<endl;
    return 0;
}


