#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF 1000000000 #define PI 3.14159265359 #define EPS 1e-12 vector d; int n, bit[200010]; void add(int a, int w) { for(int x = a; x <= n; x += x & -x) bit[x] += w; } int sum(int a) { int ret = 0; for(int x = a; x > 0; x -= x & -x) ret += bit[x]; return ret; } int main(void) { int ret = 0; ll k; cin >> n >> k; REP(i, n) { int e; cin >> e; d.push_back(e); if(i == e) ret++; } int ans = 0; for(int i=n-1; i>=0; --i) { ans += sum(d[i]); add(d[i], 1); //for(int i=1; i<=n; ++i) cout << bit[i] << " "; cout << endl; } ans = min(ans, ret-1); if(ans > k) { cout << "NO" << endl; return 0; } if((k-ans)%2) cout << "NO" << endl; else cout << "YES" << endl; return 0; }