N, K = map(int, input().split()) D = [int(i) for i in input().split()] d = 0 for i in range(N): if i + 1 != D[i]: d += 1 if not d % 2: print("YES") else: print("NO")