#include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int n = 0, k = 0; cin >> n >> k; int tmp = 0; int ct = 0; for (int i = 1; i < n + 1; i++) { cin >> tmp; if (tmp != i) { ct++; } } /* cout< k){ cout << "NO" << endl; return 0; }*/ /* if (ct % 2 == 0) {*/ if ((ct / 2) % 2 == k % 2 && k>=ct/2) { cout << "YES" << endl; } else { cout << "NO" << endl; } /*}else if (ct %2 ==1) { if (((ct-1)) % 2 == k % 2) { cout << "YES" << endl; } else { cout << "NO" << endl; } }*/ return 0; }