#include <bits/stdc++.h>
using namespace std;
bool allZero(vector<int> numbers) {
  for (int num : numbers) {
    if (num != 0) return false;
  }
  return true;
}
bool checkTypeOne(vector<int> numbers) {
  if (numbers.size() % 3 != 0) return false;
  int zero = 0;
  for (int num : numbers)
    if (num == 0) zero++;
  if (zero == numbers.size() / 3)
    return true;
  else
    return false;
}
bool checkTypeTwo(vector<int> numbers) {
  if (numbers.size() % 3 != 0) return false;
  set<int> S;
  for (int num : numbers) S.insert(num);
  if (S.size() != 3) return false;
  numbers.assign(S.begin(), S.end());
  if ((numbers[0] ^ numbers[1] ^ numbers[2]) == 0) return true;
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<int> numbers(n);
  for (int i = 0; i < n; i++) cin >> numbers[i];
  bool possible;
  if (allZero(numbers) || checkTypeOne(numbers) || checkTypeTwo(numbers))
    possible = true;
  else
    possible = false;
  cout << (possible ? "Yes" : "No") << endl;
  return 0;
}
