#include <bits/stdc++.h>
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;
}
using namespace std;
signed main(void) {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < (n); i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() > 3) {
    cout << "No\n";
    return 0;
  }
  if (mp.size() == 3) {
    long long x = 0;
    for (auto p : mp) {
      x ^= p.first;
      if (p.second * 3 != n) {
        cout << "No\n";
        return 0;
      }
    }
    if (x == 0) {
      cout << "Yes\n";
      return 0;
    } else {
      cout << "No\n";
      return 0;
    }
  }
  if (mp.size() == 2) {
    if (mp[0] * 3 == n * 2) {
      cout << "Yes\n";
      return 0;
    } else {
      cout << "No\n";
      return 0;
    }
  }
  if (mp.size() == 1) {
    if (mp[0] == n) {
      cout << "Yes\n";
      return 0;
    } else {
      cout << "No\n";
      return 0;
    }
  }
}
