#include <bits/stdc++.h>
using namespace std;
bool calc(int a, int b, int c) {
  return (((a ^ b) == c) && ((a ^ c) == b) && ((b ^ c) == a));
}
int main() {
  int n;
  cin >> n;
  unordered_map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  int a = -1;
  int b = -1;
  int c = -1;
  for (pair<int, int> p : mp) {
    int nm = p.first;
    if (a == -1)
      a = nm;
    else if (b == -1)
      b = nm;
    else
      c = nm;
  }
  if (calc(a, b, c) || calc(a, c, b) || calc(b, a, c) || calc(b, c, a) ||
      calc(c, a, b) || calc(c, b, a)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
