#include <bits/stdc++.h>
using namespace std;
int n, no;
int a[100005];
int b[100005];
map<int, int> m;
void read() {
  cin >> n;
  no = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (m.find(a[i]) == m.end()) {
      b[no] = a[i];
      no++;
    }
    m[a[i]]++;
  }
}
bool check() {
  if (no != 3) return false;
  n = 3;
  for (int i = 0; i < 3; i++) {
    if ((b[(i + n - 1) % n] ^ b[(i + 1) % n]) != b[i]) return false;
  }
  int ct = m[b[0]];
  for (auto it = m.begin(); it != m.end(); it++) {
    if ((*it).second != ct) return false;
  }
  return true;
}
int main() {
  read();
  if (check())
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
