#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    mp[a[i]]++;
  }
  if (mp.size() == 1) {
    printf("%s\n", mp[0] ? "Yes" : "No");
  } else if (mp.size() == 2) {
    int x = mp[0], y = n - mp[0];
    if (x && x * 2 == y)
      printf("Yes\n");
    else
      puts("No");
  } else if (mp.size() == 3) {
    int x[3], y[3], cur = 0;
    for (auto p : mp) {
      x[cur] = p.second;
      y[cur++] = p.first;
    }
    if (x[0] == x[1] == x[2] && (y[0] ^ y[1]) == y[2])
      puts("Yes");
    else
      puts("No");
  } else
    puts("No");
  return 0;
}
