#include <bits/stdc++.h>
using namespace std;
int N;
map<int, int> cnter;
vector<int> unzue;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    int ipt;
    cin >> ipt;
    if (cnter.find(ipt) == cnter.end()) {
      cnter[ipt] = 1;
      unzue.push_back(ipt);
    } else
      cnter[ipt] += 1;
  }
  if (unzue.size() == 1) {
    if (unzue[0] == 0) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else if (unzue.size() == 2) {
    int x = unzue[0];
    int y = unzue[1];
    if (x == 0) {
      if (N % 3 == 0 && cnter[x] * 2 == cnter[y]) {
        cout << "Yes" << endl;
      }
    } else if (y == 0) {
      if (N % 3 == 0 && cnter[y] * 2 == cnter[x]) {
        cout << "Yes" << endl;
      }
    } else
      cout << "No" << endl;
  } else if (unzue.size() == 3) {
    int x = unzue[0];
    int y = unzue[1];
    int z = unzue[2];
    if (cnter[x] == cnter[y] && cnter[y] == cnter[z] && x ^ y == z) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
