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