#include <bits/stdc++.h>
using namespace std;
int n;
struct node {
  int val, cnt;
} nodes[5];
bool solve() {
  int a;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    bool f = true;
    for (int i = 0; i < cnt; ++i)
      if (nodes[i].val == a) ++nodes[i].cnt, f = false;
    if (f) {
      nodes[cnt].cnt = 1, nodes[cnt].val = a;
      ++cnt;
      if (cnt > 3) return false;
    }
  }
  if (n % 3 == 0) {
    for (int i = 0; i < cnt; ++i)
      if (nodes[i].cnt % (n / 3)) return false;
    return true;
  } else {
    return cnt == 1;
  }
}
int main() {
  cin >> n;
  if (n == 3) {
    int a, b, c;
    cin >> a >> b >> c;
    if (a ^ b ^ c)
      cout << "No";
    else
      cout << "Yes";
  } else {
    if (solve())
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
