#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool ok = true;
  if (n % 3 == 0) {
    int a1 = a[0];
    int a2 = a[1];
    int a3 = a1 ^ a2;
    for (int i = 0; i < (n); ++i) {
      if (i % 3 == 0 && a[i] != a1) {
        ok = false;
        break;
      } else if (i % 3 == 1 && a[i] != a2) {
        ok = false;
        break;
      } else if (i % 3 == 2 && a[i] != a3) {
        ok = false;
        break;
      }
    }
  } else {
    for (int i = 0; i < (n); ++i) {
      if (a[i] != 0) {
        ok = false;
        break;
      }
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
