#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = {0, 1, 0, -1};
const int dj[] = {1, 0, -1, 0};
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>
int finder(vector<T> vec, T number) {
  auto itr = find(vec.begin(), vec.end(), number);
  size_t index = distance(vec.begin(), itr);
  if (index != vec.size())
    return 1;
  else
    return 0;
}
long long frac(long long n) {
  if (n == 0) return 1;
  return (n * frac(n - 1)) % MOD;
}
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;
}
int main(int argc, char** argv) {
  long long ans = 0;
  long long n, x;
  cin >> n;
  map<long long, long long> m;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    m[x]++;
  }
  if (m.size() > 3 || m.size() == 2) {
    cout << "No\n";
  } else if (m.size() == 1) {
    if (m[0])
      cout << "Yes\n";
    else
      cout << "No\n";
  } else {
    vector<pair<long long, long long> > v;
    for (auto y : m) {
      v.push_back(y);
    }
    if (v[0].second == v[1].second && v[0].second && v[2].second &&
        v[1].second && v[2].second && (v[0].first ^ v[1].first) == v[2].first)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
