#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
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;
}
inline void init() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  init();
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = (int)(0); i < (int)(N); ++i) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp[0] == N) {
    puts("Yes");
    return 0;
  } else if (N % 3) {
    puts("No");
    return 0;
  }
  vector<int> vec;
  for (auto p : mp) {
    if (p.second % (N / 3)) {
      puts("No");
      return 0;
    }
    for (int i = (int)(0); i < (int)(p.second / (N / 3)); ++i)
      vec.push_back(p.first);
  }
  if (vec[0] ^ vec[1] ^ vec[2] == 0)
    puts("Yes");
  else
    puts("No");
  return 0;
}
