#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a1 = -1, b1 = -1, c1 = -1, flag = 1, a = 0, b = 0, c = 0;
  float a2, b2, c2;
  scanf("%d", &n);
  int arr[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    if (flag == 1) {
      if (a == 0) {
        a1 = arr[i];
        a++;
      } else if (b == 0 && arr[i] != a1) {
        b1 = arr[i];
        b++;
      } else if (c == 0 && arr[i] != a1 && arr[i] != b1) {
        c1 = arr[i];
        c++;
      } else if (arr[i] == a1 && arr[i] != b1 && arr[i] != c1) {
        a++;
      } else if (arr[i] == b1 && arr[i] != a1 && arr[i] != c1) {
        b++;
      } else if (arr[i] == c1 && arr[i] != a1 && arr[i] != b1) {
        c++;
      } else
        flag = 0;
    }
  }
  if (flag == 1) {
    a2 = a;
    b2 = b;
    c2 = c;
    if (a2 == (float)n / 3 && b2 == (float)n / 3 && c2 == (float)n / 3 &&
        ((a1 ^ b1) ^ c1) == 0)
      ;
    else
      flag = 0;
  }
  if (flag == 1)
    printf("Yes");
  else
    printf("No");
  return 0;
}
