#include <bits/stdc++.h>
using namespace std;
const string YES = "Yes";
const string NO = "No";
void solve(long long N, std::vector<long long> a) {
  bool b = 1;
  for (int i = 0; i < N; ++i) {
    if (a[i] != 0) b = 0;
  }
  if (b) {
    cout << "Yes" << endl;
    return;
  }
  map<long long, long long> s;
  for (int i = 0; i < N; ++i) {
    s[a[i]]++;
  }
  if (s.size() == 3) {
    vector<long long> as(0), bs(0);
    for (auto itr = s.begin(); itr != s.end(); ++itr) {
      as.push_back(itr->first);
      bs.push_back(itr->second);
    }
    if (bs[0] == bs[1] && bs[2] == bs[1]) {
      if ((as[0] ^ as[1]) == as[2]) {
        cout << "Yes" << endl;
        return;
      }
    }
  }
  cout << "No" << endl;
  return;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, std::move(a));
  return 0;
}
