#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
map<T, T> primeFactor(T n) {
  map<T, T> res;
  for (T i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n] = 1;
  return res;
}
template <typename T>
bool IsPrimeNumber(T num) {
  if (num <= 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
inline vll move(vll p, char d) {
  if (d == 'U') {
    p[0]--;
  } else if (d == 'D') {
    p[0]++;
  } else if (d == 'R') {
    p[1]++;
  } else if (d == 'L') {
    p[1]--;
  }
  return p;
}
int main() {
  ll n;
  ll a;
  map<ll, ll> m;
  vll tmp(3);
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> a;
    m[a]++;
  }
  if (m.size() == 1) {
    if (m.begin()->first == 0) {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  if (n % 3 != 0) {
    cout << "No" << '\n';
    return 0;
  }
  if (m.size() == 2) {
    if (m[0] == n / 3) {
      cout << "Yes" << '\n';
      return 0;
    }
  } else if (m.size() == 3) {
    a = 0;
    for (auto itr = m.begin(); itr != m.end(); itr++) {
      if (itr->second == n / 3) {
        tmp[a] = itr->first;
        a++;
      } else {
        cout << "No" << '\n';
        return 0;
      }
    }
    if (tmp[0] ^ tmp[1] ^ tmp[2] == 0) {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  cout << "No" << '\n';
  return 0;
}
