#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e+14;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
void Yes() {
  cout << "Yes" << endl;
  exit(0);
}
void No() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  long long a[100100];
  for (int i = 0; i < N; i++) cin >> a[i];
  if (N % 3 == 0) {
    bool flag = true;
    long long d = a[0], b = a[1], c = a[2];
    int k = N / 3;
    for (int i = 0; i < k; i++) {
      if (a[3 * i] != d || a[3 * i + 1] != b || a[3 * i + 2] != c) {
        flag = false;
      }
    }
    if (flag == true && d ^ b == c) {
      Yes();
    } else {
      No();
    }
  } else {
    for (int i = 0; i < N; i++) {
      if (a[i] != 0) No();
    }
    Yes();
  }
  return 0;
}
