#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp[0] == n / 3 && mp[a[n - 1]] == n * 2 / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  int cnt = 0;
  int x = 0;
  for (auto &p : mp) {
    x ^= p.second;
    if (p.second == n / 3) {
      cnt++;
    }
  }
  if (x == 0 && cnt == 3) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
