long a[1<<18],k;i,j,n; main(){ scanf("%d%ld",&n,&k); for(i=1;i<=n;i++)scanf("%d",a+i); for(j=1;j<=n&&k>=0;j++)while(a[j]!=j){ i=a[j]; a[j]=a[i]; a[i]=i; k--; } j=!puts(k&1?"NO":"YES"); }