#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> a, b;
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    int ia;
    cin >> ia;
    mp[ia]++;
  }
  for (auto& m : mp) {
    a.push_back(m.first);
    b.push_back(m.second);
  };
  if (mp.size() == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    if (b[0] == b[1] * 2) {
      if ((a[0] ^ a[1]) == a[0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (b[1] == b[0] * 2) {
      if ((a[1] ^ a[0]) == a[1]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 3) {
    if ((a[0] ^ a[1]) == a[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
