#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N], n;
int main() {
  scanf("%d", &n);
  int sum = 0, sum1 = 0, sum2 = 0, sum3 = 0, x = -1, y = -1, z = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0)
      sum++;
    else if (x == -1)
      x = a[i], sum1 = 1;
    else if (a[i] == x)
      sum1++;
    else if (y == -1)
      y = a[i], sum2 = 1;
    else if (a[i] == y)
      sum2++;
    else if (z == -1)
      z = a[i], sum3 = 1;
    else if (a[i] == z)
      sum3++;
    else {
      puts("No");
      return 0;
    }
  }
  if (sum == n) {
    puts("Yes");
    return 0;
  }
  if (n % 3 != 0) {
    puts("No");
    return 0;
  }
  if (sum1 != 0 && sum2 != 0 && sum3 != 0) {
    if ((sum1 == sum2) && (sum2 == sum3) && (x ^ y ^ z == 0))
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  if (sum2 != 0 || sum3 != 0) {
    puts("No");
    return 0;
  }
  if (sum * 2 == sum1)
    puts("Yes");
  else
    puts("No");
  return 0;
}
