package main import ( "fmt" "sort" ) func main() { var N, K int fmt.Scan(&N, &K) D := make([]int, N) d := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&D[i]) d[i] = D[i] } sort.Ints(d) var cnt int for i := 0; i < N; i++ { if D[i] != d[i] { cnt++ } } cnt /= 2 // fmt.Println(cnt, K) // fmt.Println(cnt%2, K%2) if cnt%2 == K%2 { fmt.Println("YES") } else { fmt.Println("NO") } }