#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool read(T &n) {
  T ans = 0, flag = 1;
  char ch;
  while ((ch = getchar()) < '0' || ch > '9')
    if (ch == '-')
      flag = -1;
    else if (ch == EOF)
      return false;
  ans = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') ans = ans * 10 + ch - '0';
  n = ans * flag;
  return true;
}
inline long long read() {
  long long ans = 0, flag = 1;
  char ch;
  while ((ch = getchar()) < '0' || ch > '9')
    if (ch == '-') flag = -1;
  ans = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') ans = ans * 10 + ch - '0';
  return ans * flag;
};
int pre[100005];
unordered_map<int, int> M;
vector<int> v, v2;
int main() {
  int n, cnt = 0;
  read(n);
  for (register int i = 1; i <= n; i++) {
    read(pre[i]);
    if (M.find(pre[i]) == M.end()) {
      M[pre[i]] = ++cnt;
      v.push_back(1);
      v2.push_back(pre[i]);
    } else
      v[M[pre[i]] - 1]++;
  }
  if (n % 3 == 0) {
    if ((v.size() == 1 && pre[1] == 0) ||
        (v.size() == 3 && v[0] == v[1] && v[1] == v[2] &&
         v2[0] ^ v2[1] == v2[2]))
      puts("Yes");
    else if (v.size() == 2) {
      if (max(v[0], v[1]) == 2 * min(v[0], v[1]) && (v2[0] == 0 || v2[1] == 0))
        puts("Yes");
      else
        puts("No");
    } else
      puts("No");
  } else {
    if (v.size() == 1 && pre[1] == 0) puts("Yes");
    puts("No");
  }
  return 0;
}
