#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  unordered_map<int, int> A;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A[a]++;
  }
  bool ok = false;
  if (A.size() == 3) {
    int x = 0;
    for (auto a : A) x ^= a.first;
    if (x == 0) ok = true;
  } else if (A.size() == 2) {
    int z = -1, n = -1;
    for (auto a : A) {
      if (a.first == 0)
        z = a.second;
      else
        n = a.second;
    }
    if (z == N / 3 && n == N * 2 / 3) ok = true;
  } else if (A.size() == 1) {
    bool zero = false;
    for (auto a : A) {
      if (a.first == 0) zero = true;
    }
    if (zero) ok = true;
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
