#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  long long x;
  unordered_map<long long, int> freq;
  vector<int> occurence;
  vector<long long> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (freq.count(x))
      freq[x]++;
    else
      freq[x] = 1;
  }
  for (auto& it : freq) {
    a.push_back(it.first);
    occurence.push_back(it.second);
  }
  if (a.size() != 2 && a.size() != 3) {
    cout << "No\n";
    return 0;
  }
  if (a.size() == 2) {
    if ((a[0] == 0 && a[1] == 1 && occurence[1] == 2 * occurence[0]) ||
        (a[0] == 1 && a[1] == 0 && occurence[0] == 2 * occurence[1]))
      cout << "Yes\n";
    else
      cout << "No\n";
    return 0;
  }
  if (a.size() != 3) {
    cout << "No\n";
    return 0;
  }
  if (occurence[0] != occurence[1] || occurence[1] != occurence[2] ||
      occurence[2] != occurence[0]) {
    cout << "No\n";
    return 0;
  }
  if ((a[0] ^ a[1]) != a[2]) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  return 0;
}
