#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    if (m.find(x) == m.end()) m.insert({x, 0});
    m[x]++;
  }
  long long int a = m.begin()->first, c = prev(m.end(), 1)->first;
  if (a == 0 && m[a] == n)
    cout << "Yes";
  else if (n % 3 == 0) {
    if (m.size() == 2) {
      if (a == 0 && m[a] == n / 3 && m[c] == 2 * n / 3)
        cout << "Yes";
      else
        cout << "No";
    } else if (m.size() == 3) {
      long long int b = next(m.begin(), 1)->first;
      if ((a ^ b ^ c == 0) && m[a] == n / 3 && m[b] == n / 3 && m[c] == n / 3)
        cout << "Yes";
      else
        cout << "No";
    }
  } else
    cout << "No";
}
