#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  map<int, int> p;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    p[a]++;
  }
  if (p.size() == 1) {
    if (p[0] == n) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (p.size() == 3 && n % 3 == 0) {
    int a, b, c;
    auto itr = p.begin();
    a = (itr++)->first;
    b = (itr++)->first;
    c = (itr++)->first;
    cout << a << b << c << endl;
    if (p[a] == p[b] && p[b] == p[c] && a == (b ^ c)) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (p.size() == 2 && n % 3 == 0) {
    int a, b;
    auto itr = p.begin();
    a = (itr++)->first;
    b = (itr++)->first;
    if (a == 0 && p[a] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
