#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int a[N];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  if (a[1] ^ a[1 + n / 3] != a[1 + n / 3 + n / 3]) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i <= n / 3; i += 3) {
    if (a[i] != a[1] || a[i + n / 3] != a[1 + n / 3] ||
        a[i + n / 3 + n / 3] != a[1 + n / 3 + n / 3]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
