#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
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() == 1) {
    for (auto mp : M) {
      if (mp.first == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      return 0;
    }
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (M.size() == 2) {
    for (auto mp : M) {
      if (mp.first == 0 && mp.second == N / 3)
        cout << "Yes" << endl;
      else if (mp.first != 0 && mp.second == 2 * N / 3)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      return 0;
    }
  } else if (M.size() == 3) {
    int tmp = 0;
    for (auto mp : M) {
      if (mp.second == N / 3) {
        tmp ^= mp.first;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    if (tmp == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
