#include <bits/stdc++.h>
using namespace std;
bool check(map<int, int> &m) {
  int M = m.size();
  vector<int> k(M);
  vector<int> v(M);
  int i = 0;
  for (auto &p : m) {
    k[i] = p.first;
    v[i] = p.first;
    i++;
  }
  int a, b, c;
  if (M == 1) {
    a = b = c = k[0];
  } else if (M == 2) {
    if (v[0] * 2 == v[1]) {
      a = k[0];
      b = c = k[1];
    } else if (v[0] == v[1] * 2) {
      a = b = k[0];
      c = k[1];
    } else {
      return false;
    }
  } else if (M == 3) {
    a = k[0];
    b = k[1];
    c = k[2];
  } else {
    return false;
  }
  return a ^ b == c;
}
int main() {
  int N;
  cin >> N;
  map<int, int> m;
  for (int i = 0; i < N; i++) {
    int ai;
    cin >> ai;
    if (m.find(ai) == m.end()) m[ai] = 0;
    m[ai]++;
  }
  cout << (check(m) ? "Yes" : "No") << endl;
  return 0;
}
