#include <bits/stdc++.h>
using namespace std;
int a[200000];
int main() {
  int n;
  cin >> n;
  set<int> se;
  for (int i = 0; i < (n); i++) {
    scanf("%d", &a[i]);
    se.insert(a[i]);
  }
  vector<int> v;
  for (int i : se) v.push_back(i);
  if (v.size() != 2 && v.size() != 3) {
    puts("No");
    return 0;
  }
  if (v.size() == 2) {
    if (v[0] != 0) {
      puts("No");
      return 0;
    }
    int c1 = 0, c2 = 0;
    for (int i = 0; i < (n); i++) {
      if (a[i] == v[1])
        c1++;
      else
        c2++;
    }
    if (c1 == c2 * 2) {
      puts("Yes");
      return 0;
    } else {
      puts("No");
      return 0;
    }
  } else {
    if ((v[0] ^ v[1]) != v[2]) {
      puts("No");
      return 0;
    }
    int c1 = 0, c2 = 0, c3 = 0;
    for (int i = 0; i < (n); i++) {
      if (a[i] == v[0]) c1++;
      if (a[i] == v[1]) c2++;
      if (a[i] == v[2]) c3++;
    }
    if (c1 == c2 && c2 == c3) {
      puts("Yes");
      return 0;
    } else {
      puts("No");
      return 0;
    }
  }
}
