#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  map<int, int> ma;
  cin >> N;
  for (int i = 0; i < (N); i++) {
    cin >> A;
    ma[A]++;
  }
  if (ma.size() == 3) {
    pair<int, int> a[3];
    int i = 0;
    for (auto it = ma.begin(); it != ma.end(); it++) {
      a[i++] = *it;
    }
    if (((a[0].first ^ a[1].first) == a[2].first) &&
        (a[0].second == a[1].second) && (a[1].second && a[2].second)) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (ma[0] > 0) {
    if (ma[0] * 3 == N) {
      for (auto it = ma.begin(); it != ma.end(); it++) {
        if ((*it).first == 0) continue;
        if ((*it).second % 2 != 0) {
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (ma.size() == 0) {
    if ((*ma.begin()).first == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
