#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> ma;
  for (int i = 1; i <= n; i++) {
    int val;
    cin >> val;
    ma[val]++;
  }
  if (ma.find(0) != ma.end() && ma[0] == n)
    cout << "Yes";
  else if (n % 3 != 0)
    cout << "No";
  else {
    if (ma.size() != 3)
      cout << "No";
    else {
      int ans = 0;
      for (auto i : ma) {
        if (i.second != n / 3) {
          cout << i.first << " " << i.second;
          cout << "No";
          return 0;
        }
        ans ^= i.first;
      }
      cout << (ans == 0 ? "Yes" : "No");
    }
  }
}
