def yourname(N, K, D): j = 0 for i in range(2 * N): d = D[j] if d == j + 1: j += 1 if j > N - 1: break continue else: D[j], D[d - 1] = D[d - 1], D[j] K -= 1 if K >= 0: if K % 2 == 0: return 'YES' else: return 'NO' else: return 'NO' def main(): N, K = map(int, input().split()) D = list(map(int, input().split())) print(yourname(N, K, D)) if __name__ == '__main__': main()