#include <bits/stdc++.h>
using namespace std;
int a[100010], n, cnt, m;
template <typename T>
inline void read(T& x) {
  x = 0;
  int f(1);
  char ch(getchar());
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x = f * x;
}
bool judge1() {
  for (register int i(1); i <= n; ++i)
    if (a[i] != 0) return false;
  return true;
}
bool judge2() {
  if (n % 3 != 0) return false;
  sort(a + 1, a + n + 1);
  for (register int i(1); i <= n / 3; ++i)
    if (a[i] != 0) return false;
  return true;
}
bool judge3() {
  if (n % 3 != 0) return false;
  sort(a + 1, a + n + 1);
  map<int, int> m;
  for (register int i(1); i <= n; ++i) m[a[i]]++;
  if (m[1] == m[2] && m[2] == m[3] &&
      a[1] ^ a[n / 3 + 1] ^ a[n / 3 * 2 + 1] == 0)
    return true;
  return false;
}
int main() {
  read(n);
  for (register int i(1); i <= n; ++i) read(a[i]);
  if (judge1() || judge2() || judge3())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
