#include <bits/stdc++.h>
using namespace std;
bool check(map<int, int> m, int a, int b, int n) {
  --m[a];
  --m[b];
  int x = a, y = b;
  for (int i = 2; i < n; ++i) {
    int z = x ^ y;
    if (m[z] < 0) return false;
    x = y;
    y = z;
  }
  return (x ^ y) == a;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    ++m[a];
  }
  bool ans = check(m, m.begin()->first, m.rbegin()->first, n);
  cout << (ans ? "Yes" : "No") << "\n";
  return 0;
}
