#include <bits/stdc++.h>
using namespace std;
const long mod = 1e9 + 7;
const int size = 1e5;
int main() {
  int N;
  cin >> N;
  int A[N];
  set<int> count;
  bool flag = true;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    count.insert(A[i]);
    if (A[i]) flag = false;
  }
  if (flag) {
    puts("Yes");
    return 0;
  }
  vector<int> v;
  for (int i : count) v.push_back(i);
  if (v.size() == 2) {
    if (v[0]) {
      puts("No");
      return 0;
    }
    int a = 0, b = 0;
    for (int i = 0; i < N; i++) {
      if (A[i])
        a++;
      else
        b++;
    }
    if (a == b)
      puts("Yes");
    else
      puts("No");
    return 0;
  } else if (v.size() == 3) {
    if ((v[0] ^ v[1]) != v[2]) {
      puts("No");
      return 0;
    }
    int a = 0, b = 0, c = 0;
    for (int i = 0; i < N; i++) {
      if (A[i] == v[0])
        a++;
      else if (A[i] == v[1])
        b++;
      else
        c++;
    }
    if (a == b && b == c)
      puts("Yes");
    else
      puts("No");
    return 0;
  } else {
    puts("No");
    return 0;
  }
}
