n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] cnt = 0 for i in range(len(d)): if d[i] != i + 1: cnt += 1 if cnt % 2 == 0 and k % 2 == 1: print('YES') else: print('NO')