#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  bool flag = true;
  if (n % 3 == 0) {
    int k = n / 3;
    sort(a.begin(), a.end());
    vector<int> m;
    for (int i = 0; i < 3; i++) {
      m.push_back(a[k * i]);
      for (int j = 1; j < k; j++) {
        if (a[j + k * i] != m[i]) flag = false;
      }
    }
    if (m[0] ^ m[1] != m[2]) flag = false;
  } else {
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
