#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  map<int, int> M;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    M[a]++;
  }
  if (N % 3 != 0) {
    if (M[0] == N) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else {
    int tmp[3] = {}, num[3] = {};
    int cnt = 0;
    bool f = true;
    for (auto it = M.begin(); it != M.end(); it++) {
      if ((*it).second == 0) continue;
      if (cnt >= 3) f = false;
      tmp[cnt] = (*it).first;
      num[cnt] = (*it).second;
      cnt++;
    }
    if (!f) {
      cout << "No" << endl;
      return 0;
    }
    if (cnt == 2) {
      if (num[0] == N / 3 && num[1] == N * 2 / 3 && tmp[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    } else if (cnt == 3) {
      if (num[0] == N / 3 && num[1] == N / 3 && num[2] == N / 3 &&
          ((tmp[0] ^ tmp[1]) ^ tmp[2]) == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
  }
  return 0;
}
