#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int n;
  cin >> n;
  int ar[n];
  set<int> s;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    s.insert(ar[i]);
  }
  int flag;
  int a[3], c[3] = {0};
  i = 0;
  for (auto it = s.begin(); it != s.end(); ++it) {
    a[i] = *it;
    i++;
  }
  if (s.size() == 3 && a[0] ^ a[1] ^ a[2] == 0) {
    flag = 1;
  } else {
    flag = 0;
  }
  for (i = 0; i < n; i++) {
    if (ar[i] == a[0]) {
      c[0]++;
    }
    if (ar[i] == a[1]) {
      c[1]++;
    }
    if (ar[i] == a[2]) {
      c[2]++;
    }
  }
  if (abs(c[0] - c[1]) == 0 && abs(c[2] - c[1]) == 0 && flag == 1) {
    flag = 1;
  } else {
    flag = 0;
  }
  if (flag == 1)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
