#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
signed main() {
  long long N;
  cin >> N;
  std::vector<long long> v(N);
  for (long long i = 0; i < N; i++) cin >> v[i];
  sort(v.begin(), v.end());
  map<long long, long long> m;
  for (long long i = 0; i < N; i++) m[v[i]]++;
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  };
  if (m.size() == 1) {
    if (v[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    };
  }
  std::vector<long long> w(3);
  long long cnt = 0;
  for (auto p : m) w[cnt++] = p.first;
  if (m.size() == 3) {
    if (w[0] ^ w[1] != w[2]) {
      cout << "No" << endl;
      return 0;
    };
    for (auto p : m)
      if (p.second * 3 != N) {
        cout << "No" << endl;
        return 0;
      };
    cout << "Yes" << endl;
    return 0;
  }
  if (w[0] != 0) {
    cout << "No" << endl;
    return 0;
  };
  if (m[0] * 3 != N) {
    cout << "No" << endl;
    return 0;
  };
  cout << "Yes" << endl;
  return 0;
}
