#include <bits/stdc++.h>
using namespace std;
int n, a[100010], l[10];
vector<int> v;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  if (v[0] == 0) {
    if (v.size() > 2) {
      cout << "No" << endl;
      return 0;
    }
    if (v.size() == 1) {
      cout << "Yes" << endl;
      return 0;
    } else if (v.size() == 2) {
      for (int i = 0; i < n; i++) {
        if (a[i] == v[0]) l[0]++;
        if (a[i] == v[1]) l[1]++;
      }
      if (l[0] * 2 == l[1])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    return 0;
  }
  if (v.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == v[0]) l[0]++;
    if (a[i] == v[1]) l[1]++;
    if (a[i] == v[2]) l[2]++;
  }
  if (l[0] == l[1] && l[1] == l[2] &&
      (v[0] ^ v[1] == v[2] || v[1] ^ v[2] == v[0] || v[0] ^ v[2] == v[1]))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
