import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}

		boolean judge = false;
		long beforeA = 0;
		long nextA = 0;
		for (int i = 1; i < n - 1; i++) {
			beforeA = a[i-1];
			nextA = a[i+1];
			if ( a[i] != (beforeA ^ nextA)) {
				judge = false;
				break;
			}
			judge = true;
		}
		if (a[0] != (a[1] ^ a[n-1])) {
			judge = false;
		}
		if (a[n-1] != (a[0] ^ a[n-2])) {
			judge = false;
		}

		System.out.println(judge ? "Yes" : "No");
		sc.close();
	}
}
