#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  cin >> N;
  vector<long long> cap(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> cap[i];
  }
  long long a, b, c;
  a = -1;
  b = -1;
  c = -1;
  bool three = true;
  for (int i = 0; i < N; i++) {
    if (a == -1)
      a = cap[i];
    else if (cap[i] != a && a != -1 && b == -1)
      b = cap[i];
    else if (cap[i] != a && a != -1 && cap[i] != b && b != -1 && c == -1)
      c = cap[i];
    else if (cap[i] != a && cap[i] != b && cap[i] != c && c != -1)
      three = false;
  }
  if (a == -1 || b == -1 || c == -1) three = false;
  if (a == 0 && b != -1 && c == -1) {
    long long numa = 0;
    long long numb = 0;
    for (int i = 0; i < N; i++) {
      if (cap[i] == a) numa++;
      if (cap[i] == b) numb++;
    }
    if (numa * 2 == numb) three = true;
  }
  if (a != -1 && b == 0 && c == -1) {
    long long numa = 0;
    long long numb = 0;
    for (int i = 0; i < N; i++) {
      if (cap[i] == a) numa++;
      if (cap[i] == b) numb++;
    }
    if (numa == numb * 2) three = true;
  }
  if (a == 0 && b == -1 && c == -1) cout << "Yes" << endl;
  if (a == 0 && b != -1 && c == -1 && three) cout << "Yes" << endl;
  if (a != -1 && b == 0 && c == -1 && three)
    cout << "Yes" << endl;
  else if (three && N % 3 == 0) {
    long long numA = 0;
    long long numB = 0;
    long long numC = 0;
    for (int i = 0; i < N; i++) {
      if (cap[i] == a) numA++;
      if (cap[i] == b) numB++;
      if (cap[i] == c) numC++;
    }
    long long d = a ^ b;
    if (c == d && numA == numB && numA == numC)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
