n, k = map(int, raw_input().split()) d = map(int, raw_input().split()) x = 0 for i in xrange(n): if d[i] != i+1: x += 1 if x == 0: x += 1 if (x-1) % 2 == k % 2 and x-1 <= k: print "YES" else: print "NO"