#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool zero = true;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) zero = false;
    mp[a[i]]++;
  }
  if (zero) {
    cout << "Yes" << endl;
    return 0;
  }
  bool f = false;
  if (mp.size() <= 3) {
    f = true;
    int check = 0;
    for (auto e : mp) check ^= e.first;
    if (check != 0) {
      f = false;
      return 0;
    }
    if (mp.size() == 2) {
      f = false;
      for (auto e : mp) {
        if (e.first == 0 && e.second * 3 != n) f = true;
      }
    } else {
      for (auto e : mp) {
        if (e.second * 3 != n) f = false;
      }
    }
  }
  cout << (f ? "Yes" : "No") << endl;
  return 0;
}
