#include <bits/stdc++.h>
using namespace std;
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;
}
template <class T>
void YesNo(T a) {
  cout << (a ? "Yes" : "No") << "\n";
}
template <class T>
void YESNO(T a) {
  cout << (a ? "YES" : "NO") << "\n";
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void uniq(vector<long long>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
const long long MOD = 1000000007;
const long long INF = LLONG_MAX / 2;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No"
         << "\n";
    return 0;
  }
  vector<long long> a(n), b;
  map<long long, long long> ma;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    ma[a[i]]++;
  }
  if (ma.size() == 3) {
    for (auto x : ma) {
      if (x.second != n / 3) {
        cout << "No"
             << "\n";
        return 0;
      } else
        b.push_back(x.first);
    }
    if ((b[0] ^ b[1]) == b[2])
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else if (ma.size() == 2) {
    for (auto x : ma) {
      if (x.first == 0 && x.second == n / 3) continue;
      if (x.second == n / 3 * 2) continue;
      cout << "No"
           << "\n";
      return 0;
    }
    cout << "Yes"
         << "\n";
  } else
    cout << "No"
         << "\n";
  return 0;
}
