#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  map<long long, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
  }
  if (mp[0] == n) return !printf("Yes");
  if (n % 3 != 0) return !printf("No");
  vector<long long> res;
  for (auto ele : mp) {
    for (int j = 0; j < ele.second / (n / 3); j++) {
      res.push_back(ele.first);
    }
  }
  if (res.size() == 3 && (res[0] ^ res[1] ^ res[2] == 0))
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
