#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> da(n);
  for (int i = 0; i < n; i++) {
    cin >> da[i];
  }
  map<int, int> dic;
  for (int i = 0; i < n; i++) {
    if (dic.count(da[i])) {
      dic[da[i]]++;
    } else {
      dic[da[i]] = 1;
    }
  }
  bool ju = bool(n % 3);
  if (dic.size() == 3) {
    for (auto i : dic) {
      if (i.second != n / 3) {
        ju = true;
        break;
      }
    }
  } else {
    ju = true;
  }
  if (ju) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> co(3);
  int SSSSS = 0;
  for (auto i : dic) {
    co[SSSSS] = i.first;
    SSSSS++;
  }
  vector<vector<bool>> bin(2, vector<bool>(32));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 32; j++) {
      bin[i][j] = bool(co[i] % 2);
      co[i] /= 2;
    }
  }
  vector<bool> ans(32);
  for (int i = 0; i < 32; i++) {
    ans[i] = bin[0][i] ^ bin[1][i];
  }
  int anser = 0;
  SSSSS = 1;
  for (int i = 0; i < 32; i++) {
    if (ans[i]) {
      anser += SSSSS;
    }
    SSSSS *= 2;
  }
  if (anser == co[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
