#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1000000007;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> m;
  for (int i = 0; i < (N); ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (m.size() == 3) {
    if (N % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    int X[3];
    int i = 0;
    for (auto iter = m.begin(); iter != m.end(); iter++) {
      X[i] = iter->first;
      if (iter->second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
      i++;
    }
    if (X[0] ^ X[1] ^ X[2] == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (m.size() == 2) {
    if (N % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    int X[2];
    int cnt[2];
    int i = 0;
    for (auto iter = m.begin(); iter != m.end(); iter++) {
      X[i] = iter->first;
      cnt[i] = iter->second;
      i++;
    }
    if (X[0] > X[1]) {
      swap(X[0], X[1]);
      swap(cnt[0], cnt[1]);
    }
    if (X[0] == 0 && cnt[1] == N * 2 / 3) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (m.size() == 1) {
    auto iter = m.begin();
    int X = iter->first;
    if (X == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
