#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], n;
map<int, int> M;
bool test() {
  if (M.size() > 3) return false;
  if (M.size() == 1) return M.begin()->first == 0;
  if (M.size() == 2) {
    auto it = M.begin();
    ++it;
    return it->second = 2 * M.begin()->second;
  } else {
    vector<int> vec, cnt;
    for (auto i : M) {
      vec.push_back(i.first);
      cnt.push_back(i.second);
    }
    return (vec[0] ^ vec[1]) == vec[2] && cnt[0] == cnt[1] && cnt[1] == cnt[2];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i), M[a[i]]++;
  puts(test() ? "Yes" : "No");
}
