#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  set<int> S;
  for (int i = (int)0; i < (int)N; i++) {
    cin >> A[i];
    S.insert(A[i]);
  }
  if (S.size() == 3 && A.size() % 3 == 0) {
    int a, b, c;
    a = *(S.begin());
    S.erase(a);
    b = *(S.begin());
    S.erase(b);
    c = *(S.begin());
    S.erase(c);
    int cnta, cntb, cntc;
    cnta = cntb = cntc = 0;
    for (int i = (int)0; i < (int)N; i++) {
      if (A[i] == a) cnta++;
      if (A[i] == b) cntb++;
      if (A[i] == c) cntc++;
    }
    if (a ^ b == c && cnta == cntb && cntb == cntc) {
      cout << "Yes" << endl;
    }
  } else if (S.size() == 2 && A.size() % 3 == 0) {
    int a, b;
    a = *(S.begin());
    S.erase(a);
    b = *(S.begin());
    S.erase(b);
    int cnta, cntb;
    cnta = cntb = 0;
    if (a ^ b == b) {
      for (int i = (int)0; i < (int)N; i++) {
        if (A[i] == a) cnta++;
        if (A[i] == b) cntb++;
      }
      if (cntb == cnta * 2) {
        cout << "Yes" << endl;
      }
    }
    if (a ^ b == a) {
      for (int i = (int)0; i < (int)N; i++) {
        if (A[i] == a) cnta++;
        if (A[i] == b) cntb++;
      }
      if (cnta == 2 * cntb) {
        cout << "Yes" << endl;
      }
    }
  } else if (S.size() == 1) {
    int a = *(S.begin());
    if (a == 0) {
      cout << "Yes" << endl;
    }
  } else {
    cout << "No" << endl;
  }
};
