#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  if (a[0] == 0 && a.front() == a.back()) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3) {
    set<int> s;
    for (int i = 0; i < n; i++) s.insert(a[i]);
    if (a[0] != 0 || s.size() > 2) {
      cout << "No" << endl;
      return 0;
    }
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (a[i] == 0) cnt++;
    if (abs(n - cnt * 2) <= 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    set<int> s;
    for (int i = 0; i < n; i++) s.insert(a[i]);
    if (s.size() != 3) {
      cout << "No" << endl;
      return 0;
    }
    vector<int> x(3);
    int now = 0;
    for (auto itr = s.begin(); itr != s.end(); itr++) {
      x[now] = *itr;
      now++;
    }
    bool flag = true;
    for (int i = 0; i < 3; i++) {
      for (int j = i + 1; j < 3; j++) {
        if ((x[i] ^ x[j]) != x[3 - i - j]) flag = false;
      }
    }
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
