n, k = [int(i) for i in input().split()] d = [int(i) for i in input().split()] def sort(d): cnt = 0 for i in range(len(d)): if d[i] == i + 1: continue for j in range(i, len(d)): if d[j] == i + 1: d[i], d[j] = d[j], d[i] cnt += 1 break return cnt if (k - sort(d)) % 2 == 0: print('YES') else: print('NO')