#include <bits/stdc++.h>
using namespace std;
long long a[100005];
int main(int argc, char** argv) {
  map<int, int> cnt, vis;
  int n;
  cin >> n;
  long long ans = 0, a2 = 0, aa = 0, b = 0, c = 0;
  for (int i = 1; i <= n; i++)
    scanf("%lld", &a[i]), cnt[a[i]]++, ans ^= a[i], a2 = max(a2, a[i]);
  for (int i = 1; i <= n; i++) {
    if (!aa && !vis.count(a[i]))
      aa = a[i];
    else if (!b && !vis.count(a[i]))
      b = a[i];
    else if (!c && !vis.count(a[i]))
      c = a[i];
    vis[a[i]]++;
  }
  if (n == 3 && a[1] ^ a[2] ^ a[3] == 0) {
    printf("Yes");
    return 0;
  }
  if (n % 3 == 0 && cnt[1] == cnt[2] && cnt[0] == n / 3) {
    printf("Yes");
    return 0;
  }
  if (a2 == 0) {
    printf("Yes");
    return 0;
  }
  if (ans != 0 || (n % 3 != 0) || (!aa || !b || !c) || (aa ^ b != c) ||
      (cnt[aa] != cnt[b]) || (cnt[aa] != cnt[c])) {
    printf("No");
    return 0;
  }
  printf("Yes");
  return 0;
}
