#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b[3] = {-1, -1, -1}, c[3] = {}, end = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    bool A = false;
    for (int j = 0; j < 3; j++) {
      if (b[j] == a) {
        c[j]++;
        A = true;
      }
    }
    if (A == false) {
      if (end == 3) {
        cout << "No" << endl;
        return 0;
      }
      b[end] = a;
      end++;
    }
  }
  if ((c[0] != c[1] || c[0] != c[2] || c[1] != c[2]) && c[1] != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (((b[0] ^ b[1]) ^ b[2]) == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
