#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int n, a;
  cin >> n;
  vector<int> A(n);
  set<int> B;
  if (n % 3 != 0) {
    for (int i = 0; i < (int)(n); i++) {
      cin >> A[i];
      B.insert(A[i]);
    }
    cout << "No" << endl;
  } else {
    for (int i = 0; i < (int)(n); i++) {
      cin >> A[i];
      B.insert(A[i]);
    }
    sort(A.begin(), A.end());
    if (B.size() > 3)
      cout << "No" << endl;
    else if (B.size() == 1) {
      bitset<32> d(A[0]);
      if ((d ^ d ^ d) == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (B.size() == 3) {
      int m1 = A[n / 3 - 1], m2 = A[n / 3], m3 = A[n * 2 / 3 - 1],
          m4 = A[n * 2 / 3];
      if (m1 != m2 && m3 != m4) {
        bitset<32> d(m1);
        bitset<32> e(m2);
        bitset<32> f(m4);
        bitset<32> g(0);
        if ((d ^ e ^ f) == g)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    } else {
      int m1 = A[n / 3 - 1], m2 = A[n / 3], m3 = A[n * 2 / 3 - 1],
          m4 = A[n * 2 / 3];
      if (m3 != m4) {
        bitset<32> d(m3);
        bitset<32> e(m4);
        bitset<32> g(0);
        if ((d ^ e ^ d) == g)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else if (m1 != m2) {
        bitset<32> d(m1);
        bitset<32> e(m2);
        bitset<32> g(0);
        if ((d ^ e ^ e) == g)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    }
  }
}
