def yourname(N, K, D): iniD = [n for n in range(1, N + 1)] for i in range(len(D)): d = D[i] if iniD[i] == d: continue else: idx = iniD.index(d) iniD[i], iniD[idx] = iniD[idx], iniD[i] 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()