#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) {
    sort(arr, arr + n);
    for (long long int i = 0; i < n; i++) {
      if (arr[i] > 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (m.size() == 2) {
    if (!m.count(0)) {
      cout << "No" << endl;
      return 0;
    }
    sort(arr, arr + n);
    for (long long int i = 0; i < n; i++) {
      if (i % 3 == 0) {
        ans.push_back((long long int)0);
      } else {
        ans.push_back(arr[n - 1]);
      }
    }
    if ((ans[n - 1] ^ ans[n - 2]) != ans[0]) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
    return 0;
  }
  map<long long int, long long int>::iterator it = m.begin();
  vector<long long int> v;
  while (it != m.end()) {
    v.push_back(it->first);
    it++;
  }
  ans.clear();
  ans.push_back(v[0]);
  ans.push_back(v[1]);
  map<long long int, long long int> m1 = m;
  m[v[0]]--;
  m[v[1]]--;
  bool flag = true;
  for (long long int i = 2; i < n; i++) {
    long long int x = (ans[i - 2] ^ ans[i - 1]);
    if (m.count(x) && m[x] != 0) {
      m[x]--;
      ans.push_back(x);
    } else {
      flag = false;
      break;
    }
  }
  if (ans[0] != (ans[n - 1] ^ ans[n - 2])) {
    flag = false;
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  ans.clear();
  m = m1;
  ans.push_back(v[0]);
  ans.push_back(v[2]);
  m[v[0]]--;
  m[v[2]]--;
  flag = true;
  for (long long int i = 2; i < n; i++) {
    long long int x = (ans[i - 2] ^ ans[i - 1]);
    if (m.count(x) && m[x] != 0) {
      m[x]--;
      ans.push_back(x);
    } else {
      flag = false;
      break;
    }
  }
  if (ans[0] != ans[n - 1] ^ ans[n - 2]) {
    flag = false;
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
