#include <bits/stdc++.h>
using namespace std;
const int N = 80000;
int n;
long long a[N + 5];
int C[N + 5];
vector<long long> V;
int main() {
  int T;
  T = 1;
  while (T--) {
    V.clear();
    C[0] = 0;
    scanf("%d", &n);
    for (register int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
      C[i] = 0;
    }
    bool p = 1;
    for (register int i = 1; i <= n; i++) {
      int f = -1;
      for (register int j = V.size() - 1; j >= 0; j--)
        if (V[j] == a[i]) f = j;
      if (!~f) {
        V.push_back(a[i]);
        C[V.size() - 1] = 1;
        if (V.size() > 3) {
          p = 0;
          break;
        }
      } else
        C[f]++;
    }
    if (!p) {
      printf("No\n");
      continue;
    }
    if (V.size() == 1) {
      if (V[0] == 0)
        printf("Yes\n");
      else
        printf("No\n");
      continue;
    }
    if (n % 3) {
      if (V.size() == 1 && V[0] == 0) printf("Yes\n");
      printf("No\n");
      continue;
    }
    if (V.size() > 3) {
      printf("No\n");
      continue;
    }
    if (V.size() == 2) {
      if (V[0] == 0 && C[0] == n / 3)
        printf("Yes\n");
      else if (V[1] == 0 && C[1] == n / 3)
        printf("Yes\n");
      else
        printf("No\n");
      continue;
    }
    if (V.size() == 3) {
      if (V[0] ^ V[1] ^ V[2])
        printf("No\n");
      else if (C[0] == C[1] && C[1] == C[2])
        printf("Yes\n");
      else
        printf("No\n");
      continue;
    }
  }
  return 0;
}
