#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
namespace output {
void pr(int x) { cout << x; }
void pr(long x) { cout << x; }
void pr(ll x) { cout << x; }
void pr(unsigned x) { cout << x; }
void pr(unsigned long x) { cout << x; }
void pr(unsigned long long x) { cout << x; }
void pr(float x) { cout << x; }
void pr(double x) { cout << x; }
void pr(ld x) { cout << x; }
void pr(char x) { cout << x; }
void pr(const char* x) { cout << x; }
void pr(const string& x) { cout << x; }
void pr(bool x) { pr(x ? "true" : "false"); }
template <class T>
void pr(const complex<T>& x) {
  cout << x;
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x);
template <class T>
void pr(const T& x);
template <class T, class... Ts>
void pr(const T& t, const Ts&... ts) {
  pr(t);
  pr(ts...);
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x) {
  pr("{", x.f, ", ", x.s, "}");
}
template <class T>
void pr(const T& x) {
  pr("{");
  bool fst = 1;
  for (const auto& a : x) pr(!fst ? ", " : "", a), fst = 0;
  pr("}");
}
void print() { pr("\n"); }
template <class T, class... Ts>
void print(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pr(" ");
  print(ts...);
}
}  // namespace output
using namespace output;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int N;
  cin >> N;
  vi arr(N);
  for (int i = (0); i < (N); ++i) cin >> arr[i];
  map<int, int> occ;
  for (int i = (0); i < (N); ++i) occ[arr[i]]++;
  if (occ.size() > 3) {
    print("No");
    return 0;
  }
  if (N % 3 != 0) {
    if (occ.size() == 1) {
      print("Yes");
    } else {
      print("No");
    }
    return 0;
  }
  vi reps;
  for (pair<int, int> x : occ) {
    if (x.second % (N / 3) != 0) {
      print("No");
      return 0;
    }
    if (x.second == 3 * (N / 3)) reps.push_back(x.first);
    if (x.second == 2 * (N / 3)) reps.push_back(x.first);
    reps.push_back(x.first);
  }
  int a = reps[0];
  int b = reps[1];
  int c = reps[2];
  if ((a ^ c == b) && (b ^ a == c) && (b ^ c == a)) {
    print("Yes");
  } else {
    print("No");
  }
}
