#include <bits/stdc++.h>
using namespace std;
int n, svs = -1;
int ns[3], sv[3];
bool ans = true;
int main() {
  scanf("%d", &n);
  if (n % 3 != 0)
    for (int i = 1; i <= n; i++) {
      int tp;
      scanf("%d", &tp);
      if (tp != 0) ans = false;
    }
  else {
    for (int i = 1; i <= n; i++) {
      int tp, ap = 0;
      scanf("%d", &tp);
      for (int i = 0; i < svs; i++)
        if (sv[i] == tp) {
          ns[i]++;
          ap = 1;
        }
      if (ap == 0)
        if (svs < 2) {
          sv[++svs] = tp;
          ns[svs]++;
        } else
          ans = false;
    }
    if (ans)
      if (svs == 2)
        ans =
            ((sv[0] ^ sv[1] ^ sv[2]) == 0 && ns[0] == ns[1] && ns[1] == ns[2]);
      else if (svs == 1)
        ans = ((sv[1] == 0 && ns[0] * 2 == ns[1]) ||
               (sv[0] == 0 && ns[1] * 2 == ns[0]));
      else
        ans = (sv[0] == 0);
  }
  if (ans)
    printf("Yes");
  else
    printf("No");
  return 0;
}
