#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
constexpr long long mod = 1e9 + 7;
constexpr long long inf = 3e18;
long long N;
map<long long, long long> mp;
signed main() {
  cin >> N;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (N % 3 || mp.size() < 2 || mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 2) {
    if (mp[0] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp.size() == 3) {
    long long res = 0;
    for (auto p : mp) {
      if (p.second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
      res ^= p.first;
    }
    if (!res)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
