#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> s;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    s[(a[i])] = 0;
  }
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    s[(a[i])]++;
  }
  int tmp = s[(a[0])];
  for (int i = 0; i < n; ++i) {
    if (s[(a[i])] != tmp) {
      cout << "No";
      return 0;
    }
  }
  if (s.size() > 3) {
    cout << "No";
    return 0;
  }
  sort(a.begin(), a.end());
  unique(a.begin(), a.end());
  int b = a[0], c = a[1], d = a[2];
  if (b ^ c == d && c ^ d == b && d ^ b == c)
    cout << "Yes";
  else
    cout << "No";
}
