#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
using Graph = vector<vector<long long>>;
signed main() {
  long long N;
  cin >> N;
  map<long long, long long> num;
  for (long long i = 0; i < N; i++) {
    long long A;
    cin >> A;
    if (num.count(A))
      num.at(A)++;
    else
      num[A] = 1;
  }
  bool fg = true;
  if (num.size() > 3)
    fg = false;
  else if (num.size() == 3) {
    vector<long long> suzi(6);
    long long cnt = 0;
    for (auto p : num) {
      suzi.at(cnt) = p.first;
      suzi.at(cnt + 3) = p.second;
      cnt++;
    }
    long long y = suzi.at(0) ^ suzi.at(1) ^ suzi.at(2);
    if (y != 0 || suzi.at(3) != suzi.at(4) || suzi.at(4) != suzi.at(5)) {
      fg = false;
      cout << 3 << endl;
    }
  } else if (num.size() == 2) {
    if (!num.count(0))
      fg = false;
    else if (num.at(0) != N / 3)
      fg = false;
  } else if (num.size() == 1) {
    if (!num.count(0)) fg = false;
  }
  if (fg)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
