#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void sayNo() { cout << "No" << endl; }
void sayYes() { cout << "Yes" << endl; }
int main() {
  long long N;
  cin >> N;
  unordered_map<int, int> map;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    map[a]++;
  }
  long long count = 0;
  long long A[3] = {-1, -1, -1};
  long long num[3];
  for (auto itr = map.begin(); itr != map.end(); ++itr) {
    long long key = itr->first;
    long long val = itr->second;
    count++;
    if (count > 3) {
      sayNo();
      return 0;
    }
    A[count - 1] = key;
    num[count - 1] = val;
  }
  if (count == 1) {
    if (A[0] == 0) {
      sayYes();
    } else {
      sayNo();
    }
    return 0;
  }
  if (count == 2) {
    sayNo();
    return 0;
  }
  long long a01 = A[0] ^ A[1];
  long long a02 = A[0] ^ A[2];
  long long a12 = A[1] ^ A[2];
  if (a01 == A[2] || a02 == A[1] || a12 == A[0]) {
    if (num[0] == num[1] && num[1] == num[2]) {
      sayYes();
      return 0;
    }
  }
  sayNo();
  return 0;
}
