#include <bits/stdc++.h>
using namespace std;
string s;
const int max_n = 1e5 + 10;
int main() {
  int n, a[max_n];
  pair<int, int> b[3];
  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[i].first = a[i];
      b[i].second = 0;
    }
    if ((a[0] ^ a[1]) != a[2]) {
      flag = false;
    }
    for (int i = 0; i < n; ++i) {
      bool ok = false;
      for (int j = 0; j < 3; ++j) {
        if (a[i] == b[j].first) {
          ok = true;
          ++b[j].second;
          break;
        }
      }
      if (!ok) {
        flag = false;
        break;
      }
    }
    flag = (flag && b[0].second == b[1].second && b[1].second == b[2].second);
  } else {
    b[0].first = a[0];
    for (int i = 1; i < n; ++i) {
      if (a[i] != b[0].first) {
        flag = false;
        break;
      }
    }
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
