#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  long long tmp;
  long long A, B, C;
  A = -1;
  B = -1;
  C = -1;
  long long A_num, B_num, C_num;
  A_num = 0;
  B_num = 0;
  C_num = 0;
  cin >> N;
  bool judge = false;
  long long D = -1;
  for (long long i = 0; i < N; ++i) {
    cin >> tmp;
    if (A == -1) {
      A = tmp;
      A_num += 1;
    } else if (tmp == A) {
      A_num += 1;
    } else if (B == -1) {
      B = tmp;
      B_num += 1;
    } else if (tmp == B) {
      B_num += 1;
    } else if (C == -1) {
      C = tmp;
      C_num += 1;
    } else if (tmp == C) {
      C_num += 1;
    } else {
      D = 0;
    }
  }
  if (B == -1 && C == -1) {
    judge = true;
  }
  if (N % 3 == 0) {
    tmp = A ^ B;
    tmp ^= C;
    if (A_num == B_num && B_num == C_num && tmp == 0) {
      judge = true;
    } else if (A_num == 2 * B_num && C_num == 0 && B == 0) {
      judge = true;
    } else if (2 * A_num == B_num && C_num == 0 && A == 0) {
      judge = true;
    }
  }
  if (D == 0) {
    judge = false;
  }
  if (judge) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
  return 0;
}
