#include #include #include #include #define rep(i, n) for (i = 0; i < n; i++) #define rrep(i, n) for (i = n; i >= 0; i--) #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) int main() { long long n, k; scanf("%lld %lld", &n, &k); int d, ans = 0, i; rep(i, n) { scanf("%d", &d); if (d != i + 1) ans++; } if (k - (ans - 1) % 2) puts("NO"); else puts("YES"); return 0; }