#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i != n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  if (n == 3) {
    if ((arr[0] ^ arr[1]) == arr[2] || (arr[1] ^ arr[2]) == arr[0] ||
        (arr[2] ^ arr[0]) == arr[1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    int count = 1;
    vector<int> ococo(n);
    for (int i = 1; i != n; i++)
      if (arr[i - 1] != arr[i]) {
        ococo[count - 1] = i - 1;
        count++;
      }
    if (count == 1)
      cout << "No" << endl;
    else if (count != 3)
      cout << "No" << endl;
    else {
      if ((n - 1) - ococo[1] == ococo[1] - ococo[0] &&
          ococo[1] - ococo[0] == ococo[0] + 1) {
        if ((arr[0] ^ arr[ococo[0] + 1]) == arr[n - 1])
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    }
  }
  return 0;
}
