#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string answer;
  cin >> n;
  map<int, int> mp;
  vector<int> num(0);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (mp[a] == 0) num.push_back(a);
    mp[a]++;
  }
  if (num.size() == 3) {
    if (mp[num.at(0)] != mp[num.at(1)] || mp[num.at(1)] != mp[num.at(2)]) {
      answer = "No";
    } else if (num.at(0) != (num.at(1) ^ num.at(2))) {
      answer = "No";
    } else {
      answer = "Yes";
    }
  } else if (num.size() == 2) {
    if (num.at(0) == 0) {
      if (mp[0] == mp[num.at(1)] * 2) {
        answer = "Yes";
      } else {
        answer = "No";
      }
    } else if (num.at(1) == 0) {
      if (mp[num.at(0)] * 2 == mp[0]) {
        answer = "Yes";
      } else {
        answer = "No";
      }
    } else
      answer = "No";
  } else if (num.size() == 1) {
    if (num.at(0) == 0)
      answer = "Yes";
    else
      answer = "No";
  } else {
    answer = "No";
  }
  cout << answer << endl;
}
