#include <bits/stdc++.h>
using namespace std;
set<int> vals;
map<int, int> cnts;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vals.insert(x);
    cnts[x]++;
  }
  if (vals.size() == 3) {
    bool works = true;
    for (auto a : cnts) {
      if (a.second * 3 != n) {
        works = false;
      }
    }
    if (works) {
      vector<int> v;
      for (auto a : cnts) {
        v.push_back(a.first);
      }
      if (v[0] ^ v[1] ^ v[2] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
