#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    m[a]++;
  }
  if (n % 3 != 0) {
    if (m.size() == 1)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  bool flag = true;
  if (m.size() > 3)
    cout << "No"
         << "\n";
  else if (m.size() == 3) {
    long long a = 0;
    for (auto c : m) {
      a ^= c.first;
      if (c.second != (n / 3)) flag = false;
    }
    if (a != 0) flag = false;
    if (flag)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else if (m.size() == 2) {
    vector<long long> v;
    v.reserve(m.size());
    for (auto c : m) v.push_back(c.first);
    if (v[0] == 0 || v[1] == 0)
      ;
    else
      flag = false;
    if (m[v[0]] % (n / 3) != 0) flag = false;
    if (m[v[1]] % (n / 3) != 0) flag = false;
    if (flag)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else {
    if (m.count(0))
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
