#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int N, a;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < (N); ++i) {
    cin >> a;
    ++mp[a];
  }
  bool ok = true;
  if (N % 3 != 0) {
    if (mp[0] != N) ok = false;
  } else {
    if (mp.size() != 3)
      ok = false;
    else {
      if (mp[0] == N)
        ;
      else if (mp[0] > 0) {
        if (mp[0] != N / 3) ok = false;
        for (auto x : mp) {
          if (x.second % 2 != 0) ok = false;
        }
      } else {
        vector<int> num(4), cnt(4);
        int i = 0;
        for (auto x : mp) {
          num.at(i) = x.first;
          cnt.at(i) = x.second;
          ++i;
        }
        for (int i = 0; i < (3); ++i)
          if ((num.at(i % 3 + 1) ^ num.at((i + 1) % 3 + 1)) !=
              num.at((i + 2) % 3 + 1))
            ok = false;
        for (int i = 0; i < (3); ++i)
          if (cnt.at(i % 3 + 1) != cnt.at((i + 1) % 3 + 1)) ok = false;
      }
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
