#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  map<long long, long long> mm;
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    mm[t]++;
  }
  if (mm.size() == 1) {
    if (mm[0] != 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (mm.size() == 2) {
    if (mm[0] != 0) {
      for (auto it : mm) {
        if (it.first != 0) {
          long long sec = it.second;
          if (sec == 2 && mm[0] == 1) {
            cout << "Yes" << endl;
            return 0;
          } else {
            cout << "No" << endl;
            return 0;
          }
        }
      }
    }
  }
  if (mm.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  set<long long> ms;
  vector<long long> mv;
  for (auto it : mm) {
    ms.insert(it.second);
    mv.push_back(it.first);
  }
  if (ms.size() != 1) {
    cout << "No" << endl;
    return 0;
  }
  if (mv[0] != (mv[1] ^ mv[2])) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
