#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    cin >> A;
    if (mp.find(A) != mp.end())
      mp[A]++;
    else
      mp[A] = 1;
  }
  int s = mp.size();
  if (s == 1 && mp[0] == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (s == 2 && mp[0] == N / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  if (s != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> b(0), c(0);
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    b.push_back(itr->first);
    c.push_back(itr->second);
  }
  if (b[0] ^ b[1] != b[2]) {
    cout << "No" << endl;
    return 0;
  }
  if (c[0] == c[1] && c[1] == c[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
