#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if ((a[0] ^ a[1]) != a[2]) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; i += 3) {
    if (a[0] != a[i] || a[1] != a[i + 1] || a[2] != a[i + 2]) {
      cout << "No" << endl;
      return 0;
    }
  }
  a.push_back(a[0]);
  a.push_back(a[1]);
  for (int i = 0; i < (n); ++i) {
    if ((a[i] ^ a[i + 2]) != a[i + 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
