#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num;
  map<long long, long long> m;
  bool chk = true;
  cin >> num;
  vector<long long> vec(num);
  for (long long i = 0; i < num; i++) {
    cin >> vec.at(i);
    m[vec.at(i)]++;
  }
  if (num % 3 != 0) {
    for (auto itr : m) {
      if (itr.first == 0 && itr.second == num) {
        cout << "Yes";
        break;
      } else {
        cout << "No";
        break;
      }
    }
  } else {
    int cnt = 0;
    long long a = 0;
    long long b = 0;
    long long c = 0;
    for (auto itr : m) {
      if (cnt == 0) {
        a == itr.first;
        cnt++;
      } else if (cnt == 1) {
        b == itr.first;
        cnt++;
      } else if (cnt == 2) {
        c == itr.first;
        cnt++;
      }
    }
    if (cnt != 3) {
      cout << "No";
      return 0;
    }
    if ((a ^ b) == c || (a ^ c) == b || (b ^ c) == a)
      cout << "Yes";
    else
      cout << "No";
  }
}
