#include <bits/stdc++.h>
using namespace std;
const long long inf = LONG_MAX;
const long long arr = 1000000;
long long dp[2][arr];
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main(void) {
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> st;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
  }
  if (st.size() > 3 || st.size() <= 1) return cout << "No" << '\n', 0;
  if (st.size() == 2) {
    long long a = *st.begin();
    long long b = *st.rbegin();
    if ((a ^ b) == b)
      return cout << "Yes" << '\n', 0;
    else
      return cout << "No" << '\n', 0;
  }
  if (st.size() == 3) {
    long long a = *st.begin();
    long long b = *(++st.begin());
    long long c = *st.rbegin();
    if ((a ^ b) == c)
      return cout << "Yes" << '\n', 0;
    else
      return cout << "No" << '\n', 0;
  }
  return 0;
}
