#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]++;
  }
  if (m.size() == 1) {
    if (m[0] == N) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (m.size() == 3 and N % 3 == 0) {
    auto itr = m.begin();
    int b[3];
    for (int i = (0); i < (3); ++i) {
      if (itr->second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
      b[i] = itr->first;
      itr++;
    }
    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;
}
