#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> a;
int main() {
  cin >> N;
  a.assign(N, 0);
  map<int, int> cnter;
  vector<int> unzue;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (cnter.find(a[i]) == cnter.end()) {
      cnter[a[i]] = 1;
      unzue.push_back(a[i]);
    } else
      cnter[a[i]] += 1;
  }
  if (N == 3) {
    if (a[0] ^ a[1] == a[2] || a[1] ^ a[2] == a[0] || a[2] ^ a[0] == a[1]) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (unzue.size() == 3) {
    int x = unzue[0];
    int y = unzue[1];
    int z = unzue[2];
    if (cnter[x] == cnter[y] && cnter[y] == cnter[z] && x ^ y == z) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
