#include <bits/stdc++.h>
using namespace std;
int n, a[100014];
map<int, int> m;
long long f[5];
void input() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (m.size() != 3 || n % 3 != 0) {
    cout << "No";
    return;
  }
  for (auto i : m) {
    if (i.second != n / 3) {
      cout << "No";
      return;
    }
  }
  int dem = 1;
  for (auto i : m) {
    f[dem] = i.first;
    dem++;
  }
  if (f[1] ^ f[3] == f[2])
    cout << "Yes";
  else
    cout << "No";
}
int main() {
  input();
  return 0;
}
