#include <bits/stdc++.h>
using namespace std;
long long N, M, H, W, K, A, B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main() {
  cin >> N;
  vector<long long> a(5, 0);
  vector<long long> kind(0);
  bool ink = false;
  for (int i = 0; i < N; i++) {
    cin >> A;
    for (int i = 0; i < kind.size(); i++) {
      if (kind[i] == A) ink = true;
    }
    if (ink) {
      for (int i = 0; i < kind.size(); i++) {
        if (kind[i] == A) ++a.at(i);
      }
    } else {
      kind.push_back(A);
      a.at(kind.size() - 1)++;
      if (kind.size() > 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    ink = false;
  }
  if (kind.size() == 1) {
    if (kind[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (kind.size() == 2) {
    if (min(kind[0], kind[1]) == 0) {
      for (int i = 0; i < 2; i++) {
        if (kind[i] == 0) {
          if (a[i] == N / 3)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
          return 0;
        }
      }
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 0; i < 3; i++) {
    if (a.at(i) != N / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((kind[0] ^ kind[2] == kind[1]) && (kind[1] ^ kind[0] == kind[2]) &&
      (kind[1] ^ kind[2] == kind[0])) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
