#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  bool f = false;
  vector<int> l(n);
  for (auto &c : l) cin >> c;
  bool early_exit = false;
  map<int, int> m;
  for (auto c : l) {
    ++m[c];
    if (m.size() > 3) {
      early_exit = true;
      break;
    }
  }
  if (!early_exit) {
    if (m.size() == 1 and l.front() == 0)
      f = true;
    else if (m.size() == 3 and n % 3 == 0) {
      int pre = -1;
      for (auto pp : m) {
        if (pre == -1)
          pre = pp.first;
        else
          pre ^= pp.first;
      }
      if (pre == 0) {
        f = true;
        pre = -1;
        for (auto pp : m) {
          if (pre == -1)
            pre = pp.second;
          else {
            if (pre != pp.second) {
              f = false;
              break;
            }
          }
        }
      }
    }
  }
  cout << (f ? "Yes" : "No") << endl;
  return 0;
}
