# 解説を見た。なるほど。これは思いつけるべきだったか。 import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) for i in range(N): A[i]-=1 USE=[0]*N ANS=0 for i in range(N): if USE[i]==1: continue now=i USE[i]=1 count=1 while True: now=A[now] if USE[now]==1: break USE[now]=1 count+=1 #print(USE,count) if count%2==0: ANS+=1 if ANS%2==0: print("Yes") else: print("No")