#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto &x : A) cin >> x;
  int a = -1, b = -1, c = -1;
  for (auto x : A) {
    if (x != a && x != b && x != c) {
      if (a == -1)
        a = x;
      else if (b == -1)
        b = x;
      else if (x == (a ^ b))
        c = x;
      else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if (c == 0 && (a ^ b) != 0) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
