#include <bits/stdc++.h>
using namespace std;
int num[100010], n;
inline int rd() {
  int x = 0;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x;
}
inline void check(int x, int y, int z) {
  for (int i = 1; i <= x; i++)
    if (num[i] != num[1]) return;
  for (int i = 1; i <= y; i++)
    if (num[x + i] != num[x + 1]) return;
  for (int i = 1; i <= z; i++)
    if (num[x + y + i] != num[x + y + 1]) return;
  if (num[1] ^ num[x + 1] ^ num[x + y + 1] == 0) {
    puts("Yes");
    exit(0);
  }
}
int main() {
  n = rd();
  for (int i = 1; i <= n; i++) num[i] = rd();
  sort(num + 1, num + n + 1);
  int h1 = n / 3, h2 = (n + 1) / 3, h3 = (n + 2) / 3;
  check(h1, h2, h3);
  check(h1, h3, h2);
  check(h2, h1, h3);
  check(h2, h3, h1);
  check(h3, h1, h2);
  check(h3, h2, h1);
  puts("No");
  return 0;
}
