#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n;
  cin >> n;
  set<int> s;
  vector<int> v;
  for (ll i = 0; i < (ll)(n); i++) {
    int a;
    cin >> a;
    s.insert(a);
    if (v.size() < s.size()) {
      v.push_back(a);
    }
  }
  if (s.size() > 3) {
    cout << "No";
  } else if (v.size() == 1) {
    if (v[0] == 0) {
      cout << "Yes";
    }
  } else if (v.size() == 2) {
    if (n % 3 == 0) {
      cout << "Yes";
    }
  } else if (v.size() == 3) {
    bitset<17> x(v[0]);
    bitset<17> y(v[1]);
    bitset<17> z(v[2]);
    if (((x ^ y) == z || (y ^ z) == x || (z ^ x) == y) && n % 3 == 0) {
      cout << "Yes";
    }
  } else {
    cout << "No";
  }
}
