#include <bits/stdc++.h>
using namespace std;
string s;
const int max_n = 1e5 + 10;
int main() {
  int n, a[max_n];
  map<int, int> b;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  bool flag = true;
  if (n % 3 == 0) {
    for (int i = 0; i < 3; ++i) {
      b[a[i]] = 0;
    }
    if ((a[0] ^ a[1]) != a[2]) {
      flag = false;
    }
    for (int i = 0; i < n; ++i) {
      auto it = b.find(a[i]);
      if (it != b.end()) {
        ++it->second;
      } else {
        flag = false;
        break;
      }
    }
    flag = (flag && b[a[0]] == b[a[1]] && b[a[1]] == b[a[2]]);
  } else {
    for (int i = 0; i < n; ++i) {
      if (a[i] != 0) {
        flag = false;
        break;
      }
    }
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
