#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a = -1, x = 0;
  int b = -1, y = 0;
  int c = -1, z = 0;
  while (n--) {
    int m;
    cin >> m;
    if (a < 0) a = m;
    if (a == m) {
      x++;
      continue;
    }
    if (b < 0) b = m;
    if (b == m) {
      y++;
      continue;
    }
    if (c < 0) c = m;
    if (c == m) {
      z++;
      continue;
    }
    return 0 * puts("No");
  }
  if (b < 0) return 0 * puts("No");
  if (c < 0) {
    if (b) return 0 * puts("No");
    if (x != 2 * y && y != 2 * x) return 0 * puts("No");
    return 0 * puts("Yes");
  }
  if (a ^ b != c) return 0 * puts("No");
  if (x != y || x != z) return 0 * puts("No");
  puts("Yes");
}
