#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j;
  cin >> N;
  vector<int> a(N);
  vector<int> index(N);
  for (i = 0; i < N; i++) {
    cin >> a.at(i);
    index.at(i) = i;
  }
  string ret = "Yes";
  bool res = 1;
  int s1, s2;
  if (N % 2 != 2) {
    ret = "No";
  } else {
    for (i = 0; i < N; i++) {
      for (j = 0; j < N; j++) {
        res = a.at(0) ^ a.at(i) == a.at(j);
        if (res == 1) {
          s1 = a.at(i);
          s2 = a.at(j);
        }
      }
    }
    int count = 0;
    for (i = 0; i < N; i++) {
      if (a.at(i) == a.at(0)) count++;
    }
    if (count == (N / 3)) {
      count = 0;
      for (i = 0; i < N; i++) {
        if (a.at(i) == s1) count++;
      }
      if (count == (N / 3)) {
        count = 0;
        for (i = 0; i < N; i++) {
          if (a.at(i) == s2) count++;
        }
      }
    }
    if (count == (N / 3)) ret == "Yes";
  }
  cout << ret << endl;
}
