#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> b;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    int flag = 0;
    for (int j = 0; j < b.size(); j++) {
      if (a == b.at(j).first) {
        flag = 1;
        b.at(j).second++;
      }
    }
    if (!flag) {
      if (b.size() < 3) {
        b.push_back(make_pair(a, 1));
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  bool psb;
  if (b.size() == 3) {
    if (b.at(0).first ^ b.at(1).first ^ b.at(2).first == 0 &&
        b.at(0).second * 3 == n && b.at(1).second * 3 == n) {
      psb = true;
    } else
      psb = false;
  }
  if (b.size() == 2) {
    if ((b.at(0).second * 3 == n && b.at(0).first == 0) ||
        (b.at(1).second * 3 == n && b.at(1).first == 0)) {
      psb = true;
    } else
      psb = false;
  }
  if (b.size() == 1) {
    if (b.at(0).first == 0)
      psb = true;
    else
      psb = false;
  }
  cout << (psb ? "Yes" : "No") << endl;
}
