#include <bits/stdc++.h>
using namespace std;
const long long MX = 1e6;
const long long inf = 1e13;
const long long mod = 1e9 + 7;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = (0); i < (n); ++i) cin >> a[i];
  set<long long> s;
  for (long long i = (0); i < (n); ++i) {
    s.insert(a[i]);
  }
  if (s.size() == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  vector<long long> b(3, -1);
  long long d = 0;
  for (auto m : s) {
    b[d] = m;
    d++;
  }
  if (s.size() > 3 && n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (b[1] == -1) b[1] = b[0];
  if (b[2] == -1) b[2] = b[0];
  if (b[0] ^ b[1] == b[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
