N = int(input()) a = list(map(int,input().split())) G = [0] * N for i in range(N): G[i] = a[i] - 1 flg = [1] * N cnt = 0 for i in range(N): if flg[i]: idx = i cnt2 = 0 while flg[idx]: flg[idx] = 0 idx = G[idx] cnt2 += 1 if not cnt2 % 2: cnt += 1 if not cnt % 2: print('Yes') else: print('No')