#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int flag = 0;
  int a[n + 10];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int val = a[n - 1] ^ a[1];
  int fhg = a[0] ^ a[n - 2];
  if (a[0] != val) {
    cout << "No"
         << "\n";
    return 0;
  } else if (a[n - 1] != fhg) {
    cout << "No"
         << "\n";
    return 0;
  } else {
    for (int i = 1; i < n - 1; i++) {
      if (a[i] == a[i - 1] ^ a[i + 1])
        continue;
      else {
        flag == -1;
        break;
      }
    }
  }
  if (flag == 0)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  clock_t clk = clock();
  clk = clock() - clk;
  cerr << "Time Elapsed: " << fixed << setprecision(10)
       << ((long double)clk) / CLOCKS_PER_SEC << "\n";
  return 0;
}
