#include using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (n); i++) #define rep1(i, n) for(int i = 1; i < (n); i++) template istream& operator >> (istream& s, vector& v) { for (T& x: v) { s >> x; } return s;} template class BIT { private: vector bit; public: BIT(int n) : bit(vector(n+1, 0)) {} int sum(int i) { if (!i) return 0; return bit[i] + sum(i-(i&-i)); } void add(int i, int x) { if (i > size()) return; bit[i] += x; add(i+(i&-i), x); } int size() const { return bit.size()-1; } }; int main() { cin.tie(0);ios::sync_with_stdio(false); ll N, K; cin >> N >> K; vector D(N); cin >> D; BIT bit(N); int c = 0; for (auto d : D) { c += bit.sum(N) - bit.sum(d-1); bit.add(d, 1); } bool ok = (c <= K && (c&1) == (K&1)); cout << (ok ? "YES" : "NO") << endl; }