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;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

ll n,k;
set<vector<ll> > s;

void dfs(vector<ll> v) {
  if(s.count(v)) return;
  s.in(v);
  rep(i,n-k+1) {
    vector<ll> a=v;
    rotate(a.begin()+i,a.begin()+i+1,a.begin()+i+k);
    dfs(a);
  }
}

class BIT{
public:
  ll n,bit[555555];
  BIT(){fill(bit,bit+555555,0);}
  void add(ll i,ll x){
    while(i<=n){
      bit[i]+=x;
      i+=i&-i;
    }
  }
  ll sum(ll i){
    ll s=0;
    while(i>0){
      s+=bit[i];
      i-=i&-i;
    }
    return s;
  }
};

BIT b;
ll calc(vector<ll> a) {
  b=BIT();
  b.n=n+1;
  ll ans=0;
  rep(i,a.size()) {
    b.add(a[i],1);
    ans+=b.sum(n+1)-b.sum(a[i]);
  }
  return ans;
}

void solve(vector<ll> a) {
  if(n==k) {
    int k=-1;
    rep(i,n) {
      if(a[i]==1) k=i;
    }
    rotate(a.begin(),a.begin()+k,a.end());
    rep(i,n) {
      if(i+1!=a[i]) {
        //pr("No");
        PR(a,a.size());
        exit(0);
        return;
      }
    }
    //pr("Yes");
    return;
  }
  vector<ll> v;
  rep(i,n-k) v.pb(a[i]);
  ll x=calc(v);
  v.clear();
  REP(i,n-k,n) v.pb(a[i]);
  ll y=calc(v);
  if(x%2==y%2);
  else {
    pr(x,y);
    PR(a,a.size()),exit(0);
  }
  //if(x%2==y%2) pr("Yes");
  //else pr("No"),exit(0);
}

void Main() {
  cin >> n >> k;
  vector<ll> a(n);
  /*
  rep(i,n) a[i]=i+1;
  dfs(a);
  tr(it,s) {
    vector<ll> v=*it;
    PR(v,v.size());
    pr(calc(v));
    //solve(v);
  }
  return;
  */
  rep(i,n) R a[i];
  if(n==k) {
    int k=-1;
    rep(i,n) {
      if(a[i]==1) k=i;
    }
    rotate(a.begin(),a.begin()+k,a.end());
    rep(i,n) {
      if(i+1!=a[i]) {
        pr("No");
        return;
      }
    }
    pr("Yes");
    return;
  }
  if(k%2==0) pr("Yes");
  else if(calc(a)%2==0) pr("Yes");
  else pr("No");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}

