#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> vii;
template <typename T>
using vec = vector<T>;
template <class T>
using maxheap = std::priority_queue<T>;
template <class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long double Pi = std::acos(-1.0L);
const long long infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
const int mod = 1000000007;
signed main() {
  int _StartTime_ = clock();
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, p;
  cin >> n;
  map<int, int> a;
  for (int i = 0; i < ((int)(n)); i++) {
    cin >> p;
    ++a[p];
  }
  if (a.size() == 1 && a.begin()->first == 0 && a.begin()->second == n) {
    cout << "Yes" << '\n';
    return 0;
  }
  if (n % 3 == 0 && a.size() == 2 && a.begin()->first == 0 &&
      a.begin()->second == n / 3 && (++a.begin())->second == 2 * n / 3) {
    cout << "Yes" << '\n';
  } else if (n % 3 == 0 && a.size() == 3 && a.begin()->second == n / 3 &&
             (++a.begin())->second == n / 3 && (--a.end())->second == n / 3 &&
             a.begin()->first ^ (++a.begin())->first ^ (a.end())->first == 0) {
    cout << "No" << '\n';
  } else
    cout << "No" << '\n';
}
