#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  if (n % 3 != 0) {
    for (int i = 0; i < (n); i++) {
      if (a[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  long long x = a[0], y = a[n / 3], z = a[2 * n / 3];
  for (int i = 0; i < (n); i++) {
    if (i < n / 3 && x != a[i]) {
      cout << "No" << endl;
      return 0;
    }
    if (n / 3 <= i && i < 2 * n / 3 && a[i] != y) {
      cout << "No" << endl;
      return 0;
    }
    if (2 * n / 3 <= i && a[i] != z) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (x ^ y ^ z == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
