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