#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  long long ai;
  map<long long, int> count;
  set<long long> s;
  for (int i = 0; i < n; i++) {
    cin >> ai;
    s.insert(ai);
    if (count.find(ai) != count.end()) {
      count[ai] += 1;
    } else {
      count[ai] = 1;
    }
    if (s.size() > 3) {
      cout << "No" << endl;
      exit(0);
    }
  }
  long long sx = 0;
  long long s0, s1, s2;
  auto it = s.begin();
  s0 = *it;
  for (int i = 1; i < s.size(); i++) {
    it++;
    if (i == 1) {
      s1 = *it;
    } else {
      s2 = *it;
    }
  }
  if (s.size() == 1 and s0 == 0) {
    cout << "Yes" << endl;
    exit(0);
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    exit(0);
  }
  if (s.size() == 2 and (s0 * s1 == 0) and count[0] == n / 3) {
    cout << "Yes" << endl;
    exit(0);
  }
  long long xs = 0;
  if (s.size() == 3 and count[s0] == n / 3 and count[s1] == n / 3 and
      count[s2] == n / 3 and s1 ^ s2 ^ s0 == 0) {
    cout << "Yes" << endl;
    exit(0);
  }
  cout << "No" << endl;
}
