#include <bits/stdc++.h>
using namespace std;
inline void logger() { cout << endl; }
template <typename A, typename... B>
void logger(const A& a, const B&... b) {
  cout << a << " , ";
  logger(b...);
}
const long long MOD = 1000000007;
const long long MOD9 = 998244353;
const long long INF = MOD * MOD;
const int MAX = 200005;
int main() {
  int n;
  cin >> n;
  int d = 0;
  map<long long, int> mp;
  for (int(i) = 0; (i) < (n); (i)++) {
    long long x;
    cin >> x;
    if (mp[x] == 0) d++;
    mp[x]++;
  }
  if (mp.size() != 3) {
    cout << ("No") << endl;
    return 0;
  }
  vector<long long> v;
  for (auto& p : mp) v.push_back(p.first);
  if (v[0] ^ v[1] != v[2]) {
    cout << ("No") << endl;
    return 0;
  }
  cout << ("Yes") << endl;
}
