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 <string.h>
#include <vector>
using namespace std;

const int MAXN = 100000, MOD = 1000000007;

int t[MAXN + 10];

void add(int v, int d)
{
    for (; v <= MAXN; v += (v & (-v)))
        t[v] += d;
}

int sum(int r)
{
    int ans = 0;
    for (; r > 0; r -= (r & (-r)))
        ans += t[r];
    return ans;
}

int sum(int l, int r)
{
    return sum(r) - sum(l - 1);
}

int index(vector<int> p, int mod)
{
    int n = p.size();
    memset(t, 0, sizeof t);
    for (int i = 1; i <= n; ++i)
        add(i, 1);
    int fact[MAXN + 10];
    fact[0] = 1 % mod;
    for (int i = 1; i <= n; ++i)
        fact[i] = fact[i - 1] * 1ll * i % mod;
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        int id = sum(p[i] - 1);
        ans = (ans + id * 1ll * fact[n - 1 - i]) % mod;
        add(p[i], -1);
    }
    return ans;
}

int parity(vector<int> p)
{
    int n = p.size();
    memset(t, 0, sizeof t);
    int ans = 0;
    for (int i = n - 1; i >= 0; --i)
    {
        int smaller = sum(p[i] - 1);
        ans = (ans + smaller) % 2;
        add(p[i], 1);
    }
    return ans;
}

int main()
{
    cin.sync_with_stdio(false);
    int CASE = 1;
    int n, k;
    vector<int> p, q;
    cin >> n >> k;
    p.resize(n);
    q.resize(n);
    for (int i = 0; i < n; ++i)
        cin >> p[i];
    for (int i = 0; i < n; ++i)
        q[i] = i + 1;
    if (k == n)
    {
        int start = -1;
        for (int i = 0; i < n; ++i)
        {
            if (q[i] == p[0])
            {
                start = i;
                break;
            }
        }
        bool good = true;
        for (int i = 0; i < n; ++i)
        {
            if (p[i] != q[(i + start) % n])
            {
                good = false;
                break;
            }
        }
        if (good)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    else if (k % 2 == 0)
    {
        int id = index(q, MOD);
        cout << "Yes" << endl;
    }
    else
    {
        if (parity(p) == parity(q))
        {
            int id = index(q, MOD);
            if (index(q, 2) == 1)
                id = (id + MOD - 1) % MOD;
            id = id * 500000004ll % MOD;
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }
    return 0;
}
