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(i + 1 != D[i]) { cnt++; } } if(cnt / 2 > K) { System.out.println("NO"); }else { long t = K - cnt / 2; if(t % 2 == 0) { System.out.println("YES"); }else { System.out.println("NO"); } } } }