#include <bits/stdc++.h>
using namespace std;
bool solve(map<int, int>& count, int n) {
  if (count.size() == 1 && count.count(0) != 0) {
    return true;
  } else if (n % 3 == 0) {
    if (count.size() == 2 && count.count(0) == n / 3) {
      return true;
    } else if (count.size() == 3) {
      int sum = 0;
      for (auto& p : count) {
        if (p.second != n / 3) {
          return false;
        }
        sum ^= p.first;
      }
      if (sum != 0) {
        return false;
      }
      return true;
    }
  }
  return false;
}
int main() {
  map<int, int> count;
  int n;
  cin >> n;
  for (int a; cin >> a;) {
    count[a]++;
  }
  if (solve(count, n)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
