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