#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const double EPS = 1e-10;
long long const MOD = 1000000007;
long long mod_pow(long long x, long long n) {
  long long res = 1;
  for (int i = 0; i < 60; i++) {
    if (n >> i & 1) res = res * x % MOD;
    x = x * x % MOD;
  }
  return res;
}
template <typename T>
T gcd(T a, T b) {
  return b != 0 ? gcd(b, a % b) : a;
}
template <typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
void fastInput() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(void) {
  int N;
  cin >> N;
  vector<long long> A(N);
  map<long long, int> m;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    m[A[i]]++;
  }
  if (m.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i < N; i++) {
    if (m[A[i]] != m[A[i - 1]]) {
      cout << "No" << endl;
      return 0;
    }
  }
  vector<long long> b;
  for (auto i : m) {
    b.push_back(i.first);
  }
  if ((b[0] ^ b[1]) != b[2]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
