#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  int n;
  cin >> n;
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  set<int> s;
  int tem;
  for (int64_t i = (0); i < (n); i++) {
    cin >> tem;
    s.insert(tem);
  }
  if (s.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  decltype(s)::iterator it = s.begin();
  bitset<100> bs1 = *it;
  it++;
  bitset<100> bs2 = *it;
  it++;
  bitset<100> bs3 = *it;
  bitset<100> temp = bs1 ^ bs2;
  if (bs3 != temp) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
