#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() {
  int T = 1;
  while (T--) {
    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");
        continue;
      }
    }
    if (cnt == 3) {
      if (t[1].second == t[2].second && t[2].second == t[3].second &&
          (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");
    }
    memset(t, 0, sizeof t);
  }
  return 0;
}
