#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll atcoder_mod = 1e9 + 7;
template <typename T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <typename T = int, typename C = vector<T>>
C vecin(int N) {
  C x(N);
  for (int i = 0; i < (N); ++i) {
    x[i] = in<T>();
  }
  return move(x);
}
void vout() { cout << endl; }
template <typename Head, typename... Tail>
void vout(Head&& h, Tail&&... t) {
  cout << ' ' << h;
  vout(forward<Tail>(t)...);
}
void out() { cout << endl; }
template <typename Head, typename... Tail>
void out(Head&& h, Tail&&... t) {
  cout << h;
  vout(forward<Tail>(t)...);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N = in();
  map<int, int> M;
  for (int i = 0; i < (N); ++i) {
    M[in()]++;
  }
  if (M.count(0) == N || (M.size() == 2 && M.count(0) == N / 3)) {
    out("Yes");
    return 0;
  }
  if (M.size() == 3) {
    int V[3];
    auto itr = M.begin();
    for (int i = 0; i < (3); ++i) {
      if (itr->second != N / 3) {
        out("No");
        return 0;
      }
      V[i] = itr->first;
      ++itr;
    }
    if (V[0] ^ V[1] ^ V[2]) {
      out("No");
      return 0;
    }
    out("Yes");
    return 0;
  }
  out("No");
  return 0;
}
