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