#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void CHMAX(T& a, const T b) {
  if (a < b) a = b;
}
template <typename T>
inline void CHMIN(T& a, const T b) {
  if (a > b) a = b;
}
constexpr long long MOD = 1000000007ll;
const double EPS = 1e-11;
int num[3], cnt[3];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a[125252];
  cin >> n;
  for (int i = 0; i < (3); ++i) {
    num[i] = -1;
  }
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    bool ok = false;
    for (int j = 0; j < (3); ++j) {
      if (num[j] == -1) {
        num[j] = a[i];
        ++cnt[j];
        ok = true;
        break;
      } else if (num[j] == a[i]) {
        ++cnt[j];
        ok = true;
        break;
      }
    }
    if (!ok) {
      cout << "No" << '\n';
      return 0;
    }
  }
  if (num[1] == -1) {
    cout << (num[0] == 0 ? "Yes" : "No") << '\n';
    return 0;
  }
  if (num[2] == -1) {
    if (n % 3 != 2 && n % 3 != 0) {
      cout << "No" << '\n';
      return 0;
    }
    if (n % 3 == 0) {
      if (!(cnt[0] * 2 == cnt[1]) && !(cnt[0] == cnt[1] * 2)) {
        cout << "No" << '\n';
        return 0;
      }
      int idx = 0;
      if (cnt[0] * 2 == cnt[1]) {
        idx = 1;
      }
      bool can = false;
      if (num[idx] ^ num[idx] == num[(idx + 1) & 1]) {
        can = true;
      }
      cout << (can ? "Yes" : "No") << '\n';
    } else {
      if (!(cnt[0] * 2 - 1 == cnt[1]) && !(cnt[0] == cnt[1] * 2 - 1)) {
        cout << "No" << '\n';
        return 0;
      }
      int idx = 0;
      if (cnt[0] * 2 - 1 == cnt[1]) {
        idx = 1;
      }
      bool can = false;
      if (num[idx] ^ num[idx] == num[(idx + 1) & 1]) {
        can = true;
      }
      cout << (can ? "Yes" : "No") << '\n';
    }
  } else {
    if (n % 3 != 0) {
      cout << "No" << '\n';
      return 0;
    }
    for (int i = 0; i < (2); ++i) {
      if (cnt[i] != cnt[i + 1]) {
        cout << "No" << '\n';
        return 0;
      }
    }
    bool can = false;
    if (num[0] ^ num[1] == num[2] || num[1] ^ num[2] == num[0] ||
        num[2] ^ num[0] == num[1]) {
      can = true;
    }
    cout << (can ? "Yes" : "No") << '\n';
  }
  return 0;
}
