#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n;
  set<int> s;
  map<int, int> m;
  for (int i = 0; i < n; i++) cin >> x, s.insert(x), m[x]++;
  if (s.size() != 3 || n % 3) {
    cout << "No";
  } else {
    int flag = 1;
    vector<int> v;
    for (auto i : m) {
      v.push_back(i.first);
      if (i.second != n / 3) flag = 0;
    }
    if ((v[0] ^ v[1]) != v[2]) flag = 0;
    cout << (flag ? "Yes" : "No");
  }
}
