#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<vector<int>> b(n, vector<int>(60, 0));
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    for (int j = 0; j < 60; j++) {
      if (a.at(i) >> j & 1) b.at(i).at(j) = 1;
    }
  }
  sort(a.begin(), a.end());
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  if (n == 3) {
    for (int i = 0; i < 60; i++) {
      long long zero = 0, one = 0;
      for (int j = 0; j < n; j++) {
        if (b.at(j).at(i) == 0) {
          zero++;
        } else {
          one++;
        }
      }
      if (zero == n) continue;
      if (zero * 2 != one) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 == 1 & a.at(i) != a.at(i - 1)) {
      cout << "No";
      return 0;
    }
  }
  for (int i = 0; i < 60; i++) {
    long long zero = 0, one = 0;
    for (int j = 0; j < n; j++) {
      if (b.at(j).at(i) == 0) {
        zero++;
      } else {
        one++;
      }
    }
    if (zero == n) continue;
    if (zero * 2 != one) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
