#include #define REP(i,n,N) for(int i=(n);i<(int) N;i++) #define p(s) cout<<(s)<>N>>K; REP(i,0,N) { cin>>D[i]; a[D[i]]=i; } ll cnt=0; REP(i,0,N){ if(D[i]!=i+1){ D[a[i+1]]=D[i]; D[i]=i+1; swap(a[D[i]],a[i]); cnt++; } } if(cnt<=K&&(K-cnt)%2==0) p("YES"); else p("NO"); return 0; }