#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  map<int, int> count;
  for (int _a : a) {
    if (count.find(_a) == count.end())
      count[_a] = 1;
    else
      count[_a]++;
  }
  bool has_answer = false;
  if (count.size() == 3) {
    int size = -1;
    int _xor = 1;
    for (pair<int, int> _c : count) {
      if (size == -1) {
        size = _c.second;
        _xor ^= _c.first;
        continue;
      }
      has_answer = (size == _c.second and _xor == 0);
    }
  }
  if (count.size() == 2) {
    int size = -1;
    for (pair<int, int> _c : count) {
      if (size == -1) {
        size = (_c.first == 0) ? 2 * _c.second : _c.second;
        continue;
      }
      has_answer = (size == _c.second);
    }
  }
  if (count.size() == 1) {
    has_answer = (count.find(0) != count.end());
  }
  cout << (has_answer ? "Yes" : "No") << endl;
  return 0;
}
