#include <bits/stdc++.h>
using namespace std;
using vecint = vector<int>;
using ll = int64_t;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = (0); i < (n); ++i) {
    int a;
    cin >> a;
    ++m[a];
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 3) {
    auto itr = m.begin();
    int a0, c0;
    tie(a0, c0) = *itr;
    ++itr;
    int a1, c1;
    tie(a1, c1) = *itr;
    ++itr;
    int a2, c2;
    tie(a2, c2) = *itr;
    if (a2 != (a0 ^ a1)) {
      cout << "No" << endl;
      return 0;
    }
    if (c0 != c1 || c0 != c2) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
  } else if (m.size() == 2) {
    cout << "No" << endl;
  } else {
    if (m.begin()->first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
