#include <bits/stdc++.h>
using namespace std;
int n;
unordered_map<int, int> cnt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    ++cnt[tmp];
  }
  if ((int)cnt.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> d, freq;
  for (unordered_map<int, int>::iterator it = cnt.begin(); it != cnt.end();
       ++it) {
    d.push_back(it->first);
    freq.push_back(it->second);
  }
  n = d.size();
  bool res = true;
  if (n == 1) {
    res = d[0] == 0;
  } else if (n == 2) {
    if ((d[0] != 0 && d[1] != 0) ||
        (freq[1] != 2 * freq[0] && freq[0] != 2 * freq[1]))
      res = false;
    else {
      res = true;
    }
  } else {
    res = (d[0] ^ d[1]) == d[2];
  }
  if (res)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
