#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int combination(long long int n, long long int r) {
  if (r * 2 > n) r = n - r;
  long long int dividend = 1;
  long long int divisor = 1;
  for (unsigned int i = 1; i <= r; ++i) {
    dividend *= (n - i + 1);
    divisor *= i;
  }
  return dividend / divisor;
}
long long int tmp(long long int n, long long int r) {
  return combination(n + r - 1, r);
}
int main() {
  long long int N;
  vector<long long int> a_v;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long int a;
    cin >> a;
    a_v.push_back(a);
  }
  int flag = 0;
  for (int i = 1; i < N - 1; i++) {
    long long int tmp = a_v[i - 1] ^ a_v[i + 1];
    if (tmp != a_v[i]) {
      flag = -1;
    }
  }
  long long int tmp = a_v[N - 1] ^ a_v[1];
  if (tmp != a_v[0]) {
    flag = -1;
  }
  tmp = a_v[N - 2] ^ a_v[0];
  if (tmp != a_v[N - 1]) {
    flag = -1;
  }
  if (flag == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
