#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  map<long long, int> mp;
  for (int i = 0; i < N; i++) {
    mp[A[i]]++;
  }
  if (N % 3 != 0) {
    if (mp.size() != 1 && mp[0] == 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else {
    if (mp.size() != 3) {
      if (mp.size() != 2) {
        if (mp.size() != 1) {
          cout << "No" << endl;
        } else {
          if (mp[0] != 0) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        }
      } else {
        vector<P> pr(2);
        int i = 0;
        for (auto x : mp) {
          pr.at(i).first = x.first;
          pr.at(i).second = x.second;
          i++;
        }
        if (pr.at(0).second == pr.at(1).second * 2) {
          if (pr.at(0).first ^ pr.at(0).first == pr.at(1).first) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        } else if (pr.at(1).second == pr.at(0).second * 2) {
          if (pr.at(1).first ^ pr.at(1).first == pr.at(0).first) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        } else {
          cout << "No" << endl;
        }
      }
    } else {
      vector<P> pr(3);
      int i = 0;
      for (auto x : mp) {
        pr.at(i).first = x.first;
        pr.at(i).second = x.second;
        i++;
      }
      if (pr.at(0).second != pr.at(1).second ||
          pr.at(0).second != pr.at(2).second) {
        cout << "No" << endl;
      } else {
        if (pr.at(0).first ^ pr.at(1).first == pr.at(2).first) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      }
    }
  }
}
