#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  vector<pair<int, int> > v;
  for (auto e : mp) {
    v.emplace_back(pair<int, int>(e.first, e.second));
  }
  if (v[0].first == 0 && v[0].second == n)
    cout << "1Yes" << endl;
  else if ((int)v.size() < 2)
    cout << "No" << endl;
  else if (v[0].first == 0 && v[0].second == n / 3 && v[1].second == 2 * n / 3)
    cout << "2Yes" << endl;
  else if ((int)v.size() == 2)
    cout << "No" << endl;
  else if ((v[0].first ^ v[1].first ^ v[2].first) == 0 &&
           v[0].second == n / 3 && v[1].second == n / 3)
    cout << "3Yes" << endl;
  else
    cout << "No" << endl;
}
