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 x = (x+1)/2 if x % 2 == k % 2 and x <= k: print "YES" else: print "NO"