#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
long long a[MAXN + 5], d[MAXN + 5];
void solve() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%lld", &a[i]), d[i] = a[i];
  sort(a + 1, a + N + 1);
  int cnt = unique(a + 1, a + N + 1) - a - 1;
  if (cnt > 3)
    puts("No");
  else if (cnt == 3) {
    if (N % 3 || (a[0] ^ a[1] ^ a[2]))
      puts("No");
    else {
      int b[3] = {};
      for (int i = 1; i <= N; i++)
        for (int j = 0; j < 3; j++) b[j] += (d[i] == a[j + 1]);
      if (b[0] != b[1] || b[1] != b[2] || b[0] != b[2])
        puts("No");
      else
        puts("Yes");
    }
  } else if (cnt == 2) {
    if (a[1] || N % 3)
      puts("No");
    else {
      int b[2] = {};
      for (int i = 1; i <= N; i++)
        for (int j = 0; j < 2; j++) b[j] += (d[i] == a[j + 1]);
      if (2 * b[0] != b[1])
        puts("No");
      else
        puts("Yes");
    }
  } else if (cnt == 1) {
    if (a[1])
      puts("No");
    else
      puts("Yes");
  }
}
int main() { solve(); }
