#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ze = 0;
  vector<int> v;
  cin >> n;
  v.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    if (v[i] == 0) ze++;
  }
  if (ze == n || ze * 2 == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(v.begin(), v.end());
  if (v[1] == v[n / 3] && v[1 + n / 3] == v[2 * n / 3] &&
      v[1 + 2 * n / 3] == v[n]) {
    if (v[n / 3] ^ v[2 * n / 3] == v[n]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
