#include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919, MOD = 1e9 + 7;
const int64_t LINF = 8931145141919364364, LMOD = 998244353;
int main() {
  int n;
  cin >> n;
  if (n % 3 != 0) {
    for (int i = 0; i < n - 1; ++i) {
      int a;
      cin >> a;
      if (a != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    mp[a]++;
  }
  int num[4] = {};
  int idx = 0;
  for (auto i : mp) {
    if (i.second != n / 3 and i.second != 2 * n / 3 and i.second != n) {
      cout << "No" << endl;
      return 0;
    }
    num[idx] = i.first;
    idx++;
    if (idx == 4) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (num[0] ^ num[1] != num[2]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
