#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> V(n);
  for (int i = 0; i < n; i++) cin >> V[i];
  bool flag = true;
  if (n % 3 == 0) {
    if (V[1] != (V[0] ^ V[2])) flag = false;
    for (int i = 0; i < n; i++) {
      if (i % 3 == 0) {
        if (V[i] != V[0]) flag = false;
      }
      if (i % 3 == 1) {
        if (V[i] != V[1]) flag = false;
      }
      if (i % 3 == 2) {
        if (V[i] != V[2]) flag = false;
      }
    }
  } else {
    if (V[0] != 0) flag = false;
    for (int i = 1; i < n; i++) {
      if (V[i - 1] != V[i]) flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
