#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> A(N);
  bool big_flag = true;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (A[i] != 0) {
      big_flag = false;
    }
  }
  if (N % 3 == 1 || N % 3 == 2) {
    if (big_flag) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  } else {
    int cnt = 0;
    map<long long, long long> mp;
    mp.clear();
    for (int i = 0; i < N; i++) {
      long long x = A[i];
      if (mp[x] == 0) {
        mp[x]++;
        cnt++;
      } else {
        mp[x]++;
      }
    }
    if (cnt != 3) {
      if (cnt >= 4) {
        cout << "No" << endl;
        return 0;
      } else {
        if (big_flag) {
          cout << "Yes" << endl;
          return 0;
        } else {
          cout << "No" << endl;
          return 0;
        }
      }
    } else {
      vector<long long> s;
      for (auto ne : mp) {
        if (!(ne.second == 0 || ne.second == (N / 3))) {
          cout << "No" << endl;
          return 0;
        }
        if (ne.second == N / 3) {
          s.push_back(ne.first);
        }
      }
      if (s[0] ^ s[2] == s[1]) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  return 0;
}
