#include #include #include using namespace std; #define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define rep(i,n) FOR((i),0,(n)) typedef long long ll; const int INF=1e9+7; const int MAX_N=2*1e5+5; ll bit [MAX_N]; int n; ll sum(int i){ ll s=0; while(i>0){ s+=bit[i]; i-=i&-i; } return s; } void add(int i,int x){ while(i<=n){ bit[i]+=x; i+=i&-i; } } ll d[MAX_N]; int main(){ ll k; cin>>n>>k; ll ans=0; rep(i,n){ cin>>d[i]; ans+=i-sum(d[i]); add(d[i],1); } if(k-ans>=0 && (k-ans)%2==0)cout<<"YES"<