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