import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); long K = scan.nextInt(); int[]D = new int[N]; for(int i = 0; i < N; i++) { D[i] = scan.nextInt(); } scan.close(); long cnt = 0; for(int i = 0; i < N; i++) { if(D[i] == i + 1) { continue; } for(int j = i + 1; j < N; j++) { if(D[j] == i + 1) { int v = D[i]; D[i] = i + 1; D[j] = v; cnt ++; break; } } } if(cnt > K) { System.out.println("NO"); }else { long t = K - cnt; if(t % 2 == 0) { System.out.println("YES"); }else { System.out.println("NO"); } } } }