#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(1);
  int a = -1, b = -1, c = -1;
  int acount = 0, bcount = 0, ccount = 0;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    if (i == 0)
      a = num;
    else if (a != num && b == -1)
      b = num;
    else if (a != num && b != num && c == -1)
      c = num;
    else if (a != num && b != num && c != num) {
      cout << "No" << endl;
      return 0;
    }
    if (a == num) acount++;
    if (b == num) bcount++;
    if (c == num) ccount++;
  }
  if (a != -1 && b != -1 && c != -1 && acount == n / 3 && bcount == n / 3 &&
      ccount == n / 3) {
    if ((a ^ b) == c) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (c == -1 && ((a == 0 && bcount - acount == acount) ||
                         (b == 0 && acount - bcount == bcount))) {
    cout << "Yes" << endl;
    return 0;
  } else if (a == 0 && b == -1 && c == -1) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
