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>

using Int = long long int;
using std::vector;

// 加算と総和
struct SegmentTree {
    int length;
    vector<int> dat;

    int query(int ql, int qr, int nidx, int nl, int nr) {
        if (nr <= ql || qr <= nl) return 0;
        if (ql <= nl && nr <= qr) return dat[nidx];
        int vl = query(ql, qr, nidx * 2, nl, (nl + nr) / 2);
        int vr = query(ql, qr, nidx * 2 + 1, (nl + nr) / 2, nr);
        return vl + vr;
    }

    SegmentTree(int n) : length(1) {
        while (length < n) length <<= 1;
        dat.assign(length * 2, 0);
    }

    // half-open interval [ql, qr)
    int query(int ql, int qr) { return query(ql, qr, 1, 0, length); }

    void update(int idx, int e) {
        int nidx = idx + length;
        dat[nidx] += e;
        while (nidx > 0) {
            nidx >>= 1;
            dat[nidx] = dat[nidx * 2] + dat[nidx * 2 + 1];
        }
    }
};

int main() {
    int n, k;
    std::cin >> n >> k;

    vector<int> p(n);
    for (auto& x : p) {
        std::cin >> x;
        --x;
    }

    if (k == n) {
        int i;
        for (i = 0; p[i] != 0; ++i) {}
        for (int j = 0; j < n; ++j) {
            if (p[(i + j) % n] != j) {
                std::cout << "No" << std::endl;
                return 0;
            }
        }
    } else if (k % 2 == 1) {
        Int rev = 0;
        SegmentTree seg(n);
        for (auto x : p) {
            rev += seg.query(x + 1, n);
            seg.update(x, 1);
        }
        if (rev % 2 == 1) {
            std::cout << "No" << std::endl;
            return 0;
        }
    }

    std::cout << "Yes" << std::endl;
    return 0;
}

