#include <bits/stdc++.h>
using namespace std;
long n, ans;
int main() {
  cin >> n;
  if (n % 3 != 0L) {
    cout << "No" << endl;
    return 0;
  }
  vector<long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  ans = a[0] ^ a[1];
  ans ^= a[2];
  if (a.size() == 3 && ans == 0L)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
