#include <bits/stdc++.h>
using namespace std;
int n, x;
map<int, int> ma;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    ma[x]++;
  }
  if (ma.size() == 1 && ma[0])
    printf("Yes\n");
  else if (ma.size() == 3) {
    int a[10], cnt = 0;
    for (auto A : ma) a[cnt++] = A.first;
    if (a[0] ^ a[1] == a[2])
      printf("Yes\n");
    else
      printf("No\n");
  } else
    printf("No\n");
  return 0;
}
