package yukicoder; import java.util.*; import javax.swing.plaf.synth.SynthScrollBarUI; public class Q100 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for (int i = 0; i < N; ++i) { a[i] = sc.nextInt() - 1; } int[] count = new int[N]; boolean[] vis = new boolean[N]; int[] loop_size = new int[N + 1]; for (int i = 0; i < N; ++i) { vis[i] = true; count[a[i]] = count[i] + 1; if (vis[a[i]]) { ++loop_size[count[a[i]]]; } } int even = 0; for (int i = 0; i <= N; ++i) { if (i % 2 == 0 && loop_size[i] > 0) ++even; } if (even % 2 == 0) { System.out.println("Yes"); } else { System.out.println("No"); } } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }