#include <bits/stdc++.h>
using namespace std;
const long long INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;
int32_t main() {
  long long n;
  cin >> n;
  set<long long> nums;
  unordered_map<long long, long long> freqs;
  for (long long i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    ;
    if (freqs.find(x) == freqs.end()) freqs[x] = 0;
    freqs[x]++;
    nums.insert(x);
  }
  if ((long long)(nums).size() == 1) {
    if (*nums.begin() == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if ((long long)(nums).size() == 3) {
    set<long long>::iterator it = nums.begin();
    long long a = *it;
    long long b = *(++it);
    long long c = *(++it);
    if (freqs[a] == freqs[b] and freqs[b] == freqs[c] and ((a ^ b) == c))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
