#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n;
int a[maxn], b[maxn];
int main() {
  int x = 0;
  int y = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i == 3) x = 1;
    if (x == 1) b[i - 1] = a[i - 2] ^ a[i];
  }
  b[1] = a[n] ^ a[2];
  b[n] = a[n - 1] ^ a[1];
  for (int i = 1; i <= n; i++) {
    if (a[i] != b[i]) y = 1;
  }
  if (y == 0)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
