#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long long temp;
  cin >> N;
  set<long long> S;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    S.insert(temp);
  }
  if (S.size() == 1)
    cout << "No" << endl;
  else if (S.size() != 3)
    cout << "No" << endl;
  else {
    set<long long>::iterator it = S.begin();
    long long a = *it;
    it++;
    long long b = *it;
    it++;
    long long c = *it;
    if (a ^ b ^ c == 0 && N % 3 == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
