#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline bool chmin(T1& a, T2 b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class Type>
struct is_vector : std::false_type {};
template <class ValueType, class Alloc>
struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T>
inline ostream& operator<<(ostream& out, const vector<T>& v) {
  if (v.empty()) return out;
  constexpr bool is_vector_v = is_vector<T>::value;
  if (is_vector_v)
    for (auto itr = v.begin(); itr != v.end();)
      out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
  else
    for (auto itr = v.begin(); itr != v.end();)
      out << (*itr), out << ((++itr != v.end()) ? " " : "");
  return out;
}
inline void put() {}
template <class T>
inline void put(const T& first) {
  std::cout << first;
  printf("\n");
}
template <class T, class... N>
inline void put(const T& first, const N&... rest) {
  std::cout << first;
  printf(" ");
  put(rest...);
}
inline void putn() {}
template <class T, class... N>
inline void putn(const T& first, const N&... rest) {
  std::cout << first;
  printf("\n");
  putn(rest...);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> a[i];
  }
  if (n % 3 == 0) {
    sort((a).begin(), (a).end());
    vector<int> b(3);
    for (long long i = 0; i < (long long)(3); i++) {
      b[i] = a[i * n / 3];
    }
    bool flag = true;
    int temp = 0;
    for (long long i = 0; i < (long long)(3); i++) {
      temp ^= b[i];
    }
    if (temp) {
      flag = false;
    }
    for (long long i = 0; i < (long long)(3); i++) {
      for (long long j = 0; j < (long long)(n / 3); j++) {
        if (a[i] != b[j + i * 3 / n]) {
          flag = false;
        }
      }
    }
    if (flag) {
      put("Yes");
    } else {
      put("No");
    }
  } else {
    bool all0 = true;
    for (long long i = 0; i < (long long)(n); i++) {
      if (a[i] != 0) {
        all0 = false;
      }
    }
    if (all0) {
      put("Yes");
    } else {
      put("No");
    }
  }
  return 0;
}
