#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  bool all_zero = true;
  for (long long i = 0; i < (n); ++i) {
    long long tmp;
    cin >> tmp;
    if (tmp) all_zero = false;
    ++mp[tmp];
  }
  if (all_zero) {
    cout << "Yes" << endl;
    return 0;
  }
  long long input_count = mp.size();
  if (input_count > 3 || input_count < 2) {
    cout << "No" << endl;
    return 0;
  }
  if (input_count % 3) {
    cout << "No" << endl;
    return 0;
  }
  long long third_n = n / 3;
  if (input_count == 2) {
    for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) {
      if (itr->first == 0) {
        if (itr->second != third_n) {
          cout << "No" << endl;
          return 0;
        }
      } else {
        if (itr->second != third_n * 2) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  } else {
    long long should_be_zero = 0;
    for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) {
      should_be_zero ^= itr->first;
      if (itr->second != third_n) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (should_be_zero) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes";
  cout << "\n";
  return 0;
}
