#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> m;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (m.count(a))
      m[a]++;
    else
      m[a] = 1;
  }
  if (m.size() > 3)
    cout << "No" << endl;
  else if (m.size() == 3) {
    vector<pair<int, int>> v;
    for (auto p : m) v.push_back(p);
    bool ok = true;
    if (v.at(0).first ^ v.at(1).first ^ v.at(2).first != 0) ok = false;
    if (!(v.at(0).second == v.at(1).second == v.at(2).second)) ok = false;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (m.size() == 2) {
    vector<pair<int, int>> v;
    for (auto p : m) v.push_back(p);
    if (v.at(0).first == 0 && v.at(0).second * 2 == v.at(1).second) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else {
    if (m.count(0))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
