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