#include<stdio.h>
#include <stdlib.h>
#define NUM 1000000


int main() {
	int n, i;
	int a[NUM];
	int count = 1;


	scanf("%d", &n);

	if (n < 3)
		exit(0);

	for (i = 0; i < n; i++) {
		scanf("%d", &a[i];
	}

	for (i = 1; i < (n - 1); i++) {
		if ((a[i - 1] ^ a[i + 1]) != a[i]) {
			count = 0;
		}

	}

	if (count == 1)
		printf("Yes\n");
	if (count == 0)
		printf("No\n");

	return 0;
}