#include <bits/stdc++.h>
using namespace std;
int cd(bool b) {
  cout << (b ? "Yes" : "No");
  return 0;
}
int main() {
  long long N;
  cin >> N;
  unordered_map<long long, long long> m;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    m[a]++;
  }
  if (m.size() == 1) {
    return cd(m.count(0));
  } else if (N % 3 == 0) {
    if (m.size() == 2) {
      return cd(m.count(0) && (m[0] == N / 3));
    } else if (m.size() == 3) {
      vector<long long> tmp;
      for (auto e : m) {
        if (e.second != N / 3) return cd(0);
        tmp.emplace_back(e.first);
      }
      return cd((tmp[0] ^ tmp[1]) == tmp[2]);
    }
  } else
    cd(0);
}
