#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0, a; i < n; ++i) {
    cin >> a;
    mp[a]++;
  }
  bool ok = false;
  int m = (int)mp.size();
  if (m == 1) {
    if (mp[0] == n) ok = true;
  } else if (m == 2) {
    if (n % 3 == 0 && mp[0] == n / 3 && mp.end()->second == n - n / 3)
      ok = true;
  } else if (m == 3) {
    if (n % 3 == 0) {
      int x = 0;
      bool ok1 = true;
      for (auto&& [num, cnt] : mp) {
        if (cnt != n / 3) ok1 = false;
        x ^= num;
      }
      if (ok1 && x == 0) ok = true;
    }
  }
  if (ok) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
  return 0;
}
