#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int64_t first;
  int64_t middle;
  int64_t last;
  cin >> first >> middle >> last;
  if (n == 3) {
    if (middle != (last xor first)) {
      cout << "No" << endl;
    } else {
      if (last != (first xor middle)) {
        cout << "No" << endl;
      } else {
        if (first != (middle xor last)) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      if (middle != (last xor first)) {
        cout << "No" << endl;
        break;
      }
      first = middle;
      middle = last;
      if (i == n - 1) {
        last = first;
        if (middle != (last xor first)) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else {
        cin >> last;
      }
    }
  }
}
