#include <bits/stdc++.h>
using namespace std;
map<int, int> num;
int a[200005], tmp[200004];
int main() {
  int n;
  cin >> n;
  if (n % 3) {
    puts("No");
    return 0;
  }
  int cnt = 0;
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", a + i);
    if (!num[a[i]]) num[a[i]]++, tmp[++cnt];
  }
  if (cnt != 3 || (((tmp[1] ^ tmp[2]) ^ tmp[3]) != 0) ||
      (num[tmp[1]] != num[tmp[2]]) || (num[tmp[3]] != num[tmp[2]]) ||
      (num[tmp[1]] != num[tmp[3]])) {
    cout << " No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
  int ok = 1;
  for (int i = 1; i <= n; ++i)
    if (num[a[i]] != n / 3) ok = false;
  puts(ok ? "Yes" : "No");
  return 0;
}
