#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
void GG() {
  puts("No");
  exit(0);
}
map<int, int>::iterator g(int x) { return x == 0 ? mp.begin() : ++g(x - 1); }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    mp[a]++;
  }
  if (mp.size() > 3) GG();
  if (mp.size() == 1) {
    if (g(0)->first) {
      GG();
    }
  } else if (mp.size() == 2) {
    if (n % 3 == 0) {
      if (!g(0)->first && g(0)->second == 2 * g(1)->second) {
      } else if (!g(1)->first && g(1)->second == 2 * g(0)->second) {
      } else
        GG();
    } else {
      GG();
    }
  } else {
    int x = 0;
    if (n % 3 != 0) GG();
    if (g(0)->first ^ g(1)->first ^ g(2)->first) {
      GG();
    }
    if (g(0)->second == g(1)->second && g(0)->second == g(2)->second) {
    } else
      GG();
  }
  puts("Yes");
  return 0;
}
