#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  bool ans = false;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp[0] == n / 3) {
    for (auto p : mp) {
      if (p.second == 2 * n / 3) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  if (mp.size() <= 3) {
    int xyz = 0;
    for (auto p : mp) {
      xyz ^= p.first;
    }
    if (xyz == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
