#include <bits/stdc++.h>
using namespace std;
int static fast = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();
int main() {
  int n;
  cin >> n;
  vector<int> arr(n, 0);
  unordered_map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    cnt[arr[i]] += 1;
  }
  if (cnt.size() == 1 && cnt.begin()->first == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int target = n / 3;
  vector<int> ans = {};
  for (auto& p : cnt) {
    if (p.second % target != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      while (p.second > 0) {
        ans.push_back(p.first);
        p.second -= target;
      }
    }
  }
  if (ans[0] ^ ans[1] == ans[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
