#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> num;
  if (n % 3 == 0) {
    for (auto &iter : mp) {
      if (iter.second != 0) {
        if (iter.second != n / 3) {
          cout << "No" << endl;
          return 0;
        } else
          num.push_back(iter.first);
      }
    }
  }
  if (num.size() == 3 && num[0] ^ num[1] ^ num[2] == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
