#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
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;
}
const ll MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < (n); ++(i)) cin >> a[i];
  map<int, int> cnt;
  for (int x : a) ++cnt[x];
  vector<pii> ps((cnt).begin(), (cnt).end());
  int ok = 0;
  if (ps.size() == 1 && ps[0].first == 0) ok = 1;
  if (ps.size() == 3) {
    if (ps[0].second == ps[1].second && ps[0].second == ps[2].second &&
        ps[0].first ^ ps[1].first ^ ps[2].first == 0) {
      ok = 1;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
