#include <bits/stdc++.h>
using namespace std;
map<int, int> num;
int a[100010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    num[a[i]]++;
  }
  vector<int> val;
  if (n % 3 == 0) {
    if (num.size() != 3)
      cout << "No" << endl;
    else {
      int curr = -1;
      for (auto it = num.begin(); it != num.end(); it++) {
        if (curr = -1)
          curr = it->second;
        else if (it->second != curr) {
          cout << "No" << endl;
          return 0;
        }
        val.push_back(it->first);
      }
      if ((val[0] ^ val[1]) == val[2] && (val[0] ^ val[2]) == val[1] &&
          (val[1] ^ val[2]) == val[0]) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    }
  } else {
    if (num.size() > 1)
      cout << "No" << endl;
    else {
      auto it = num.begin();
      if (it->first != 0)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
  return 0;
}
