#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> data(n);
  long long a, b, c;
  for (int i = 0; i < n; i++) {
    cin >> data.at(i);
  }
  sort(data.begin(), data.end());
  int count = 0;
  a = data.at(0);
  for (int i = 0; i < n - 1; i++) {
    if (data.at(i) != data.at(i + 1)) {
      count++;
      if (count == 1) {
        b = data.at(i + 1);
      } else if (count == 2) {
        c = data.at(i + 1);
      }
    }
  }
  if (count != 2) {
    cout << "No" << endl;
    return 0;
  }
  long long tmp1 = a ^ b;
  if (tmp1 != c) {
    cout << "No" << endl;
    return 0;
  }
  int counta = 0, countb = 0, countc = 0;
  for (int i = 0; i < n; i++) {
    if (data.at(i) == a) counta++;
    if (data.at(i) == b) countb++;
    if (data.at(i) == c) countc++;
  }
  if (counta == countb && countb == countc) {
    cout << "Yes" << endl;
  } else if (a == 0 && counta == n) {
    cout << "Yes" << endl;
  } else if (a == 0 && counta * 2 == countb && count == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
