#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  int cur;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    m[cur]++;
  }
  int s = m.size();
  if (s > 3 || s == 0) {
    cout << "No" << endl;
    return 0;
  }
  if (s == 1) {
    if (cur == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (s == 2) {
    if (n % 3 != 0) {
      cout << "No" << endl;
    }
    for (auto value : m) {
      if (value.second == (n / 3) * 2) {
        continue;
      }
      if (value.second == n / 3 && value.first == 0) {
        continue;
      }
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
    return 0;
  }
  vector<int> v;
  for (auto value : m) {
    if (value.second != n / 3) {
      cout << "No" << endl;
      return 0;
    }
    v.push_back(value.first);
  }
  if ((v[0] ^ v[2]) != v[1]) {
    cout << "No" << endl;
    return 0;
  }
  if ((v[1] ^ v[0]) != v[2]) {
    cout << "No" << endl;
    return 0;
  }
  if ((v[1] ^ v[2]) != v[0]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
