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 <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <fstream>
class Bit {
	std::vector<int> vec;
public:
	Bit(const int size) : vec(size, 0) {};
	int operator[](int position) const {
		int result = 0;
		while (position >= 0) {
			result += vec[position];
			position -= ~position & (position + 1);
		}
		return result;
	}
	void increment(int position) {
		while (position < vec.size()) {
			vec[position]++;
			position += ~position & (position + 1);
		}
	}
};
int main() {
	int n, k; std::cin >> n >> k;
	std::vector<int> permutation(n); for (auto& p : permutation) std::cin >> p;
	if (n == k) {
		bool can_sort = true;
		for (auto i = 1; i < n; ++i) {
			if (permutation[i - 1] > permutation[i]) {
				if (can_sort) {
					can_sort = false;
				}
				else {
					std::cout << "No\n";
					return 0;
				}
			}
		}
		std::cout << "Yes\n";
	}
	else if (k % 2 == 0) {
		std::cout << "Yes\n";
	}
	else {
		Bit bit(n);
		long long int swap_count = 0;
		for (auto i = 0; i < n; ++i) {
			const auto p = permutation[i];
			swap_count += i - bit[p - 1];
			bit.increment(p - 1);
		}
		if (swap_count % 2 == 0) {
			std::cout << "Yes\n";
		}
		else {
			std::cout << "No\n";
		}
	}
}


