#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  bool all0 = true;
  int A[100000];
  for (int i = 0; i < (N); i++) {
    cin >> A[i];
    if (A[i]) all0 = false;
  }
  if (all0) {
    cout << ("Yes") << "\n";
    return 0;
  } else if (N % 3 != 0) {
    cout << ("No") << "\n";
    return 0;
  }
  sort(A, A + N);
  int k = 0;
  int B[3];
  int mae = -1;
  bool OK = 1;
  for (int i = 0; i < (N); i++) {
    if (mae != A[i]) {
      if (k < 3) {
        B[k] = A[i];
        mae = A[i];
        k++;
      } else {
        OK = false;
        break;
      }
    }
  }
  if ((B[0] ^ B[1]) != B[2]) OK = false;
  for (int i = 0; i < (N); i++) {
    if (A[i] != B[i % 3]) OK = false;
  }
  if (OK)
    cout << ("Yes") << "\n";
  else
    cout << ("No") << "\n";
  return 0;
}
