#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  map<int, int> m;
  for (int i = 0; i < (int)n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 1) {
    if (m[0] != 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (m.size() == 2) {
    int d[2];
    int i = 0;
    for (auto x : m) {
      d[i] = x.first;
      i++;
    }
    sort(d, d + 2);
    if (d[0] == 0 && m[d[1]] == m[d[0]] * 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (m.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  int b[3];
  int i = 0;
  for (auto x : m) {
    b[i] = x.first;
    i++;
  }
  if (!(m[b[0]] == m[b[1]] && m[b[0]] == m[b[2]])) {
    cout << "No" << endl;
    return 0;
  }
  if (b[0] ^ b[1] == b[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
