#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  bool zero = true;
  for (long long i = 0; i < n; ++i) zero &= (a[i] == 0);
  if (n % 3 != 0 && !zero) {
    cout << "No";
    return 0;
  }
  if (zero) {
    cout << "Yes";
    return 0;
  }
  long long d = 0;
  for (long long i = 0; i < n; ++i) {
    if (!mp[a[i]]) ++d;
    mp[a[i]]++;
  }
  if (d > 3) {
    cout << "No";
    return 0;
  }
  long long t1 = -1;
  vector<pair<long long, long long> > v;
  for (auto i : mp) v.push_back(make_pair(i.first, i.second));
  if (v.size() == 3) {
    for (long long i = 0; i < 3; ++i)
      if (v[i].second != n / 3) {
        cout << "No";
        return 0;
      }
    if (v[0].first ^ v[2].first ^ v[1].first == 0) {
      cout << "Yes";
      return 0;
    }
    cout << "No";
    return 0;
  }
  if (v.size() == 2) {
    if ((v[0].second == n / 3 && v[0].first == 0) ||
        (v[1].second == n / 3 && v[1].first == 0)) {
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  }
  if (v.size() == 1) {
    cout << "No";
    return 0;
  }
  cout << "Yes";
  return 0;
}
