#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5;
int N;
long long A[Maxn + 5] = {-1};
pair<long long, int> t[20];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%lld", &A[i]);
  sort(A + 1, A + N + 1);
  int cnt = 0;
  for (int i = 1; i <= N; i++) {
    if (A[i] == A[i - 1])
      t[cnt].second++;
    else
      t[++cnt].second = 1, t[cnt].first = A[i];
    if (cnt >= 3) {
      puts("No");
      return 0;
    }
  }
  if (cnt == 3) {
    if (t[1].second * 3 == N && t[2].second * 3 == N && t[3].second * 3 == N &&
        (t[1].first ^ t[2].first ^ t[3].first) == 0)
      puts("Yes");
    else
      puts("No");
  } else if (cnt == 2) {
    if (t[1].first == 0 && t[1].second * 2 == t[2].second)
      puts("Yes");
    else
      puts("No");
  } else if (cnt == 1) {
    if (t[1].first == 0)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
