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