#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int mod = 1000000007;
struct mint {
  long long x;
  mint() : x(0) {}
  mint(long long x) : x((x % mod + mod) % mod) {}
  mint& fix() {
    x = (x % mod + mod) % mod;
    return *this;
  }
  mint operator-() const { return mint(0) - *this; }
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint& a) const { return mint(*this) += a; }
  mint operator-(const mint& a) const { return mint(*this) -= a; }
  mint operator*(const mint& a) const { return mint(*this) *= a; }
  bool operator<(const mint& a) const { return x < a.x; }
  bool operator==(const mint& a) const { return x == a.x; }
};
istream& operator>>(istream& i, mint& a) {
  i >> a.x;
  return i;
}
ostream& operator<<(ostream& o, const mint& a) {
  o << a.x;
  return o;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  string ans = "";
  sort((a).begin(), (a).end());
  if (n % 3 == 0) {
    bool ok = true;
    int m = n / 3;
    vector<vector<int> > d(3, vector<int>(m));
    int k = 0;
    for (int i = 0; i < (int)(3); i++)
      for (int j = 0; j < (int)(m); j++) {
        d[i][j] = a[k];
        ++k;
      };
    for (int i = 0; i < (int)(3); i++)
      if (d[i][0] != d[i][m - 1]) ok = false;
    if (ok) {
      if (d[0][0] ^ d[1][0] != d[2][0]) ok = false;
    }
    if (ok && d[0][0] == 0) {
      if (d[1][0] != d[2][0]) ok = false;
    }
    if (ok)
      ans = "Yes";
    else
      ans = "No";
  } else {
    if (a[n - 1] == 0)
      ans = "Yes";
    else
      ans = "No";
  }
  cout << ans << endl;
}
