#include <bits/stdc++.h>
using namespace std;
bool lessPair(const std::pair<int, int>& l, const std::pair<int, int>& r) {
  return l.second < r.second;
}
bool morePair(const std::pair<int, int>& l, const std::pair<int, int>& r) {
  return l.second > r.second;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1e9 + 7;
void add(long long& a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
void sub(long long& a, long long b) {
  a -= b;
  if (a < 0) a += MOD;
}
void mul(long long& a, long long b) {
  a *= b;
  a %= MOD;
}
long long llmin(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long llmax(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long llabs(long long a) {
  if (a >= 0)
    return a;
  else
    return -a;
}
long long llmodpow(long long a, long long n) {
  if (n == 0) return 1;
  long long tmp = llmodpow(a, n / 2);
  mul(tmp, tmp);
  if (n & 1) mul(tmp, a);
  return tmp;
}
int main() {
  int N;
  cin >> N;
  long long a[N];
  map<int, int> log;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    log[a[i]]++;
  }
  if (log[0] == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 2 == 0) {
  } else if (N % 3 == 0) {
    if ((int)log.size() == 3) {
      auto it = log.begin();
      int n1 = it->second;
      int a1 = it->first;
      it++;
      int n2 = it->second;
      int a2 = it->first;
      it++;
      int n3 = it->second;
      int a3 = it->first;
      if (n1 == n2 && n2 == n3) {
        if ((a1 ^ a3) == a2 && (a2 ^ a1) == a3 && (a3 ^ a2) == a1) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
    cout << "No" << endl;
    return 0;
  } else {
    if ((int)log.size() == 2) {
      auto it = log.begin();
      int a1 = it->second;
      it++;
      int a2 = it->second;
      if (a1 == a2 * 2 || a2 == a1 * 2) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
    return 0;
  }
}
