#include using namespace std; #define int long long signed main(){ int n, k; cin >> n >> k; vector v(n); int num = 0; for(int i = 1; i <= n; i++){ cin >> v[i - 1]; if(i != v[i - 1]){ num++; } } num = (num + 1) / 2; k -= num; if(k < 0 || k % 2 != 0) cout << "NO" << endl; else cout << "YES" << endl; }