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