#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  set<int> s;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    cin >> a[i];
    s.insert(a[i]);
  }
  if (N % 3 != 0) {
    auto it = s.find(0);
    if (s.size() == 0 && it != s.end()) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  vector<int> elms(s.begin(), s.end());
  if (elms.size() == 2) {
    if (elms[0] == 0 || elms[1] == 0) {
      int cnt = count(a.begin(), a.end(), elms[0]);
      if (cnt == N / 3 || cnt == 2 * N / 3) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else if (s.size() == 3) {
    int v = elms[0] ^ elms[1] ^ elms[2];
    if (v == 0 && count(a.begin(), a.end(), elms[0]) == N / 3 &&
        count(a.begin(), a.end(), elms[1]) == N / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
