#include <bits/stdc++.h>
using namespace std;
int n, tot;
long long a[100005], a1[100005];
int main() {
  int T = 1;
  while (T--) {
    tot = 0;
    map<long long, long long> mp;
    bool f1 = 0, ff = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
      if (a[i] == 0) f1 = 1;
      mp[a[i]]++;
      if (mp[a[i]] == 1) a1[++tot] = a[i];
      if (tot > 3) {
        ff = 1;
        break;
      }
    }
    if (f1 && tot > 1)
      ff = 1;
    else if (tot <= 2)
      ff = 1;
    for (int i = 1; i < 3; i++)
      if (mp[a1[i]] != mp[a1[i + 1]]) ff = 1;
    if (ff) {
      printf("No\n");
      continue;
    }
    ff = 1;
    for (int i = 1; i <= 3; i++)
      for (int j = 1; j <= 3; j++)
        for (int k = 1; k <= 3; k++)
          if (i != j && j != k && i != k && a1[i] ^ a1[j] == a1[k]) ff = 0;
    printf("%s\n", ff ? "No" : "Yes");
  }
}
