#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  unordered_map<int, int> A;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A[a]++;
  }
  if (A.size() == 1 && A[0] > 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (A.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> a;
  vector<int> cnt;
  for (auto itr : A) {
    a.push_back(itr.first);
    cnt.push_back(itr.second);
  }
  string ans = "Yes";
  if (cnt[0] != cnt[1] || cnt[1] != cnt[2] || cnt[2] != cnt[0]) ans = "No";
  if ((a[0] ^ a[1] ^ a[2]) != 0) ans = "No";
  cout << ans << endl;
  return 0;
}
