#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  long long int arr[n];
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]]++;
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long int> ans;
  if (m.size() == 1) {
    if (!m.count((long long int)0)) {
      cout << "No" << endl;
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 2) {
    if (!m.count(0)) {
      cout << "No" << endl;
      return 0;
    }
    long long int cnt1 = m[(long long int)0];
    m.erase((long long int)0);
    long long int cnt2 = m[m.begin()->first];
    if (cnt2 != cnt1 * 2) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
    return 0;
  }
  long long int cnt1 = m[m.begin()->first], p1 = m.begin()->first;
  m.erase(m.begin()->first);
  long long int cnt2 = m.begin()->second, p2 = m.begin()->first;
  m.erase(m.begin()->first);
  long long int cnt3 = m.begin()->second, p3 = m.begin()->first;
  m.erase(m.begin()->first);
  if ((p1 ^ p2) != p3) {
    if ((p1 ^ p3) != p2) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cnt1 != cnt2 && cnt1 != cnt3) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
