#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> A;
  for (int ii = 0; ii < N; ii++) {
    int a;
    cin >> a;
    A[a]++;
  }
  vector<vector<int>> B;
  for (auto& a : A) {
    B.push_back({a.first, a.second});
  }
  if (B.size() == 1 && B[0][0] ^ B[0][0] == B[0][0]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (B.size() == 2 && B[0][0] ^ B[1][0] == B[1][0] && B[0][1] * 2 == B[1][1]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (B.size() == 3 && B[0][0] ^ B[1][0] == B[2][0] && B[0][1] == B[1][1] &&
      B[0][1] == B[2][1]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
