#include <bits/stdc++.h>
using namespace std;
bool solve2(int a, int b, int c) {
  bool ok = (a == (b ^ c));
  bool ok2 = (b == (a ^ c));
  bool ok3 = (c == (a ^ b));
  return ok && ok2 && ok3;
}
bool solve() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  map<int, int> ma;
  for (int i = 0; i < N; ++i) ma[a[i]]++;
  if (ma.size() != 3) return false;
  for (auto p : ma)
    if (ma[a[0]] != p.second) return false;
  vector<int> b;
  for (auto p : ma) b.push_back(p.first);
  return solve2(b[0], b[1], b[2]) || solve2(b[0], b[1], b[2]) ||
         solve2(b[1], b[0], b[2]) || solve2(b[1], b[2], b[3]) ||
         solve2(b[2], b[0], b[1]) || solve2(b[2], b[1], b[0]);
}
int main() {
  cout << (solve() ? "Yes" : "No") << endl;
  return 0;
}
