#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
inline bool MX(T &l, const T &r) {
  return l < r ? l = r, 1 : 0;
}
template <class T>
inline bool MN(T &l, const T &r) {
  return l > r ? l = r, 1 : 0;
}
int N;
signed main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(0);
  cin >> N;
  map<long long, int> mp;
  for (int(i) = 0; (i) < (N); ++(i)) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() > 3) {
    puts("No");
    return 0;
  }
  if (mp.size() == 1 && mp[0] == N) {
    puts("Yes");
    return 0;
  }
  if (mp.size() == 3) {
    long long tot = 0;
    for (auto p : mp) {
      if (p.second != N / 3) {
        puts("No");
        return 0;
      }
      tot ^= p.first;
    }
    if (tot != 0) {
      puts("No");
      return 0;
    }
    puts("Yes");
    return 0;
  }
  if (N % 2 == 0 && mp[0] == N / 2) {
    puts("Yes");
    return 0;
  }
  puts("No");
  return 0;
}
