#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (n % 3) {
    for (int i = 0; i < n; ++i) {
      if (a[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
      cout << "Yes" << endl;
    }
  } else {
    map<long long, int> m;
    for (auto ai : a) m[ai] = 0;
    for (auto ai : a) ++m[ai];
    if (m.size() > 3) {
      cout << "No" << endl;
    } else if (m.size() == 1) {
      if (a[0] == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (m.size() == 2) {
      long long tmp = 0;
      for (auto& mi : m) {
        if (mi.second != (n / 3) && mi.second != (2 * n / 3)) {
          cout << "No" << endl;
          return 0;
        }
        if (mi.second == (n / 3))
          tmp ^= mi.first;
        else
          tmp ^= (mi.first ^ mi.first);
      }
      if (tmp == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else {
      long long tmp = 0;
      for (auto& mi : m) {
        tmp ^= mi.first;
        if (mi.second != (n / 3)) {
          cout << "No" << endl;
          return 0;
        }
      }
      if (tmp == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
