#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;
  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);
  }
  int m = d.size();
  bool res = true;
  if (m == 1) {
    res = d[0] == 0;
  } else {
    if (m == 2) {
      res = false;
      if ((d[0] == 0 || d[1] == 0) && freq[0] == freq[1] && n % 2 == 0) {
        res = true;
      }
    } else {
      if (n % 3 != 0)
        res = false;
      else
        res = (d[0] ^ d[1]) == d[2];
    }
  }
  if (res)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
