#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No";
    return 0;
  }
  map<long long int, long long int> arr;
  vector<long long int> v;
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    if (arr[a] == 0) {
      v.push_back(a);
    }
    arr[a] = arr[a] + 1;
  }
  if (arr.size() == 3) {
    auto it = arr.begin();
    long long int prev1 = it->first;
    it++;
    long long int prev2 = it->first;
    it++;
    long long int prev3 = it->first;
    if ((prev2 ^ prev3) != prev1) {
      cout << "No";
      return 0;
    }
    it = arr.begin();
    prev1 = it->second;
    it++;
    prev2 = it->second;
    it++;
    prev3 = it->second;
    if (prev2 != prev1 || prev3 != prev1) {
      cout << "No";
      return 0;
    }
    cout << "Yes";
  } else if (arr.size() == 2) {
    if (arr[0] == 0) {
      cout << "No";
      return 0;
    } else {
      long long int p1, p2;
      auto it = arr.begin();
      p1 = it->second;
      it++;
      p2 = it->second;
      if (p2 == 2 * p1) {
        cout << "Yes";
        return 0;
      } else {
        if (it->first == 1 && p1 == p2) {
          cout << "Yes";
          return 0;
        } else {
          cout << "No";
          return 0;
        }
      }
    }
  } else {
    cout << "No";
  }
}
