#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  cin >> N;
  vector<long long int> a(N);
  set<long long int> checkSet;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    checkSet.insert(a[i]);
  }
  if (N % 3 == 0) {
    auto itr = checkSet.begin();
    if (checkSet.size() == 3) {
      if ((*itr ^ *(++itr)) == *(++itr)) {
        cout << "Yes" << endl;
        return 0;
      }
    } else if (checkSet.size() == 2) {
      int cnt1 = count(a.begin(), a.end(), *itr);
      int cnt2 = count(a.begin(), a.end(), *(++itr));
      int min;
      if (cnt1 < cnt2) {
        if (cnt1 * 2 == cnt2 && *(--itr) == 0) {
          cout << "Yes" << endl;
          return 0;
        }
      } else {
        if (cnt2 * 2 == cnt1 && *(itr) == 0) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    } else if (checkSet.size() == 1) {
      if (a[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
