#include <bits/stdc++.h>
using namespace std;
using ul = unsigned long long;
void good(bool good) { cout << (good ? "Yes" : "No") << endl; }
void set_numbers(set<int> const& st, int& x, int& y, int& z) {
  auto it = st.begin();
  if (it != st.end()) {
    x = *it;
    ++it;
  }
  if (it != st.end()) {
    y = *it;
    ++it;
  }
  if (it != st.end()) {
    z = *it;
    ++it;
  }
}
int main() {
  int N{};
  cin >> N;
  vector<int> values;
  values.reserve(N);
  for (int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    values.emplace_back(x);
  }
  multiset<int> dedup{values.begin(), values.end()};
  set<int> s{values.begin(), values.end()};
  int x{}, y{}, z{};
  switch (N % 3) {
    case 0: {
      int n = N / 3;
      switch (s.size()) {
        case 1:
          if (values[0] == 0) {
            good(true);
            return 0;
          }
          break;
        case 2:
          set_numbers(s, x, y, z);
          if (x == 0 && dedup.count(0) == 2 * n && dedup.count(y) == n) {
            good(true);
            return 0;
          }
          break;
        case 3:
          set_numbers(s, x, y, z);
          if ((x xor y) == z && dedup.count(x) == n && dedup.count(y) == n &&
              dedup.count(z) == n) {
            good(true);
            return 0;
          }
          break;
        default:
          break;
      }
      break;
    }
    case 1: {
      int n = (N - 1) / 3;
      set_numbers(s, x, y, z);
      if ((s.size() == 1 && x == 0) ||
          (s.size() == 2 && x == 0 && dedup.count(0) == n &&
           dedup.count(y) == 2 * n + 1)) {
        good(true);
        return 0;
      }
      break;
    }
    case 2: {
      int n = (N - 2) / 3;
      set_numbers(s, x, y, z);
      if ((s.size() == 1 && x == 0) ||
          (s.size() == 2 && x == 0 && dedup.count(0) == n + 1 &&
           dedup.count(y) == 2 * n + 1)) {
        good(true);
        return 0;
      }
      break;
    }
    default:
      abort();
  }
  good(false);
  return 0;
}
