#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  vector<long long int> a;
  cin >> n;
  map<long long int, long long int> m;
  for (int i = 0; i < n; ++i) {
    long long int ai;
    cin >> ai;
    m[ai]++;
    a.push_back(ai);
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 3) {
    long long int keys[3];
    int ptr = 0;
    for (auto it = m.begin(); it != m.end(); ++it) {
      keys[ptr] = it->first;
      ptr++;
    }
    if (keys[0] == (keys[1] ^ keys[2])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
