#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
int a[N];
int t[N];
int main() {
  int n;
  cin >> n;
  set<int> ss;
  multiset<int> s;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    s.insert(a[i]);
    ss.insert(a[i]);
  }
  int f = a[0];
  int tc = 0;
  if (ss.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> v(s.begin(), s.end());
  int ct = s.count(v[0]);
  for (int i = 0; i < v.size(); ++i) {
    if (s.count(v[i]) != ct) {
      cout << "No" << endl;
      return 0;
    }
    for (int j = i + 1; j < v.size(); ++j) {
      int l = v[i] ^ v[j];
      bool isBad = true;
      for (int k = 0; k < v.size(); ++k) {
        if (l == v[k]) {
          isBad = false;
        }
      }
      if (isBad) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}
