#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool all_zero = true;
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]]++;
    if (a[i] != 0) all_zero = false;
  }
  if (all_zero) {
    cout << "Yes";
    return 0;
  }
  if (m.size() > 3 || m.size() == 1) {
    cout << "No";
    return 0;
  }
  if (m.size() == 2) {
    for (auto x : m) {
      if (x.first == 0) {
        if (x.second != n / 3) {
          cout << "No";
          return 0;
        }
      } else {
        if (x.second != 2 * n / 3) {
          cout << "No";
          return 0;
        }
      }
      cout << "Yes";
      return 0;
    }
  }
  if (m.size() == 3) {
    for (auto x : m) {
      if (x.second != n / 3) {
        cout << "No";
        return 0;
      }
    }
    int ans = 0;
    for (auto x : m) {
      ans ^= x.first;
    }
    if (ans) {
      cout << "Yes";
    } else {
      cout << "No";
    }
  }
}
