#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lf = long double;
using pii = pair<int, int>;
using ppi = pair<int, pii>;
using pss = pair<short, short>;
using pll = pair<ll, ll>;
const lf PI = 3.14159265358979323846264338L;
template <typename T>
inline T umax(T& u, T v) {
  return u = max(u, v);
}
template <typename T>
inline T umin(T& u, T v) {
  return u = min(u, v);
}
int n, a[100005];
map<int, int> M;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    M[a[i]]++;
  }
  sort(a, a + n);
  int u = unique(a, a + n) - a;
  switch (u) {
    case 1:
      cout << (a[0] == 0 ? "Yes" : "No") << '\n';
      break;
    case 2:
      cout << (a[0] == 0 && (M[0] == M[a[1]] || M[0] * 2 == M[a[1]]) ? "Yes"
                                                                     : "No")
           << '\n';
      break;
    case 3:
      cout << (n % 3 == 0 && a[0] ^ a[1] == a[2] && M[a[0]] == M[a[1]] &&
                       M[a[1]] == M[a[2]]
                   ? "Yes"
                   : "No")
           << '\n';
      break;
    default:
      cout << "No\n";
  }
  return 0;
}
