#include <bits/stdc++.h>
using namespace std;
int n, A[100];
bool check1() {
  for (int i = 0; i < n; i++) {
    if (A[i] != 0) return 0;
  }
  return 1;
}
bool check2() {
  int x = -1;
  int cnt_0 = 0, cnt_x = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] != 0 && x == -1) {
      x = A[i];
    }
    if (A[i] != 0 && A[i] != x) return 0;
    if (A[i] == 0) cnt_0++;
    if (A[i] == x) cnt_x++;
  }
  return 3 * cnt_0 == 2 * n && 3 * cnt_x == n;
}
bool check3() {
  int x = A[0], y = -1, z = -1, cnt_x = 0, cnt_y = 0, cnt_z = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] != x && y == -1)
      y = A[i];
    else if (A[i] != x && A[i] != y && y != -1 && z == -1) {
      z = A[i];
      if ((x xor y) != z && (x xor z) != y && (y xor z) != x) {
        return 0;
      }
    } else if (A[i] != x && A[i] != y && A[i] != z) {
      return 0;
    }
    if (A[i] == x) cnt_x++;
    if (A[i] == y) cnt_y++;
    if (A[i] == z) cnt_z++;
  }
  return 3 * cnt_x == n && 3 * cnt_y == n && 3 * cnt_z == n && x != y &&
         x != z && y != z && x != -1 && y != -1 && z != -1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  if (check1() || check2() || check3())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
