#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using Vint = std::vector<int>;
using Vlli = std::vector<lli>;
using Wint = std::vector<Vint>;
using Wlli = std::vector<Vlli>;
using Vbool = std::vector<bool>;
using Wbool = std::vector<Vbool>;
using pii = std::pair<int, int>;
using pll = std::pair<lli, lli>;
template <class T>
using Vec = std::vector<T>;
template <class T>
using Wec = Vec<Vec<T>>;
constexpr int MOD = 1e9 + 7;
constexpr int INFi = 2e9 + 1;
constexpr lli INFl = (lli)(9e18) + 1;
const std::vector<std::pair<int, int>> DXDY = {
    {1, 0}, {-1, 0}, {0, 1}, {0, -1}};
constexpr char BR = '\n';
template <class T>
inline int argmin(std::vector<T> &vec) {
  return min_element(vec.begin(), vec.end()) - vec.begin();
}
template <class T>
inline int argmax(std::vector<T> &vec) {
  return max_element(vec.begin(), vec.end()) - vec.begin();
}
template <class S, class T>
inline void chmax(S &a, T b) {
  if (a < b) a = b;
}
template <class S, class T>
inline void chmin(S &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void reverseSORT(Vec<T> &Array) {
  std::sort(Array.begin(), Array.end(), std::greater<T>());
}
inline int BitI(int k) { return 1 << k; }
inline lli BitL(int k) { return 1LL << k; }
inline void putsDouble(double d) { printf("%.16lf\n", d); }
template <class T>
inline std::string toString(T n) {
  if (n == 0) return "0";
  std::string res;
  if (n < 0) {
    n = -n;
    while (n != 0) {
      res += (char)(n % 10 + '0');
      n /= 10;
    }
    std::reverse(res.begin(), res.end());
    return '-' + res;
  }
  while (n != 0) {
    res += (char)(n % 10 + '0');
    n /= 10;
  }
  std::reverse(res.begin(), res.end());
  return res;
}
namespace MyFunc {
using LLi = long long int;
inline LLi gcd(LLi a, LLi b) {
  while (b != 0) {
    a %= b;
    std::swap(a, b);
  }
  return a;
}
inline LLi lcm(LLi a, LLi b) { return (a * b) / MyFunc::gcd(a, b); }
inline LLi power(LLi a, LLi n) {
  LLi res = 1LL, waiting = a;
  while (n != 0LL) {
    if ((n & 1LL) != 0LL) res *= waiting;
    waiting *= waiting;
    n >>= 1;
  }
  return res;
}
inline LLi power_mod(LLi a, LLi n, LLi mod_number___ = 1e9 + 7) {
  LLi res = 1LL, waiting = a;
  while (n != 0LL) {
    if ((n & 1LL) != 0LL) {
      res *= waiting;
      res %= mod_number___;
    }
    waiting *= waiting;
    waiting %= mod_number___;
    n >>= 1;
  }
  return res;
}
inline LLi inverse_mod(LLi a, LLi mod_number___ = 1e9 + 7) {
  return MyFunc::power_mod(a, mod_number___ - 2);
}
inline LLi inverse_mod_euclid(LLi a, LLi mod_number___ = 1e9 + 7) {
  LLi b = mod_number___, u = 1, v = 0;
  while (b != 0) {
    LLi t = a / b;
    a -= t * b;
    std::swap(a, b);
    u -= t * v;
    std::swap(u, v);
  }
  u %= mod_number___;
  if (u < 0) u += mod_number___;
  return u;
}
template <typename Integer_type>
inline bool isPrime(Integer_type n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (Integer_type x = 3; x * x <= n; ++ ++x)
    if (n % x == 0) return false;
  return true;
}
inline std::vector<bool> primeTable(int n) {
  std::vector<bool> res(n + 1, true);
  res[0] = false;
  res[1] = false;
  for (int x = 2; x * x <= n; ++x)
    if (res[x]) {
      for (int i = 2 * x; i <= n; i += x) {
        res[i] = false;
      }
    }
  return std::move(res);
}
template <typename Integer_type>
inline std::vector<std::pair<Integer_type, int>> prime_factorization(
    Integer_type n) {
  std::vector<std::pair<Integer_type, int>> res(0);
  if (n <= 0) return std::move(res);
  if (n % 2 == 0) {
    n /= 2;
    int cnt = 1;
    while (n % 2 == 0) {
      n /= 2;
      cnt++;
    }
    res.emplace_back(make_pair(2, cnt));
  }
  Integer_type x = 3;
  while (x * x <= n) {
    if (n % x == 0) {
      n /= x;
      int cnt = 1;
      while (n % x == 0) {
        n /= x;
        cnt++;
      }
      res.emplace_back(make_pair(x, cnt));
    }
    ++ ++x;
  }
  if (n > 1) res.emplace_back(make_pair(n, 1));
  return std::move(res);
}
}  // namespace MyFunc
int main(void) {
  int n;
  scanf("%d", &n);
  Vint A(n);
  for (int(i) = (0); (i) < (n); ++(i)) scanf("%d", &A[i]);
  std::sort((A).begin(), (A).end());
  int cnt = 1;
  for (int i = 0; i + 1 < n; i++)
    if (A[i] != A[i + 1]) cnt++;
  if (cnt != 3) {
    puts("No");
    return 0;
  } else {
    int p, q, r;
    p = A[0];
    r = A[n - 1];
    for (int i = 0; i < n; i++) {
      if (A[i] != p and A[i] != r) q = A[i];
    }
    if ((p ^ q) == r or (q ^ r) == p or (r ^ p) == q)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
