#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    m[a]++;
  }
  bool ans = false;
  if (n % 3 == 0 && m.size() == 3) {
    pair<int, int> p[3];
    int pos = 0;
    for (auto mm : m) {
      p[pos] = mm;
      pos++;
    }
    if (p[0].second == p[1].second && p[1].second == p[2].second) {
      ans &= p[0].first == p[1].first ^ p[2].first;
      ans &= p[1].first == p[2].first ^ p[0].first;
      ans &= p[2].first == p[0].first ^ p[1].first;
    }
  }
  puts(ans ? "Yes" : "No");
  return 0;
}
