#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &e : a) cin >> e;
  map<int, int> m;
  for (auto e : a) m[e]++;
  bool ans = false;
  if (m.size() == 1)
    ans = true;
  else if (n % 3 == 0) {
    if (m.size() == 2 && m[0] == n / 3)
      ans = true;
    else if (m.size() == 3) {
      int t = 0;
      bool f = true;
      for (auto p : m) {
        t ^= p.first;
        if (p.second != n / 3) f = false;
      }
      if (t == 0 && f) ans = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
