#include <bits/stdc++.h>
using namespace std;
using _loop_int = int;
int main() {
  int n;
  cin >> n;
  if (n % 3 != 0) {
    int a[n];
    for (_loop_int i = 0; i < (_loop_int)(n); i++) {
      cin >> a[i];
      if (a[i] != a[0]) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    int a[n];
    for (_loop_int i = 0; i < (_loop_int)(n); i++) cin >> a[i];
    sort(a, a + n);
    for (_loop_int i = 0; i < (_loop_int)(n); i++) {
      if (a[i] != a[(i / (n / 3)) * (n / 3)]) {
        cout << "No" << endl;
        cout << i / (n / 3) << endl;
        return 0;
      }
    }
    long long int x = a[0] ^ a[n / 3] ^ a[2 * n / 3];
    if (x == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
