#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;
int N;
map<int, int> M;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    M[a]++;
  }
  if (M.size() > 3) {
    cout << "No\n";
    return 0;
  };
  if (M.size() == 1) {
    auto it1 = M.begin();
    if (it1->first != 0) {
      cout << "No\n";
      return 0;
    };
    {
      cout << "Yes\n";
      return 0;
    };
  }
  if (M.size() == 2) {
    if (M.begin()->first != 0) {
      cout << "No\n";
      return 0;
    };
    auto it1 = M.begin();
    auto it2 = next(it1);
    if (it1->second * 2 != it2->second) {
      cout << "No\n";
      return 0;
    };
    {
      cout << "Yes\n";
      return 0;
    };
  }
  auto it1 = M.begin();
  auto it2 = next(it1);
  auto it3 = next(it2);
  if (!(it1->second == it2->second && it2->second == it3->second)) {
    cout << "No\n";
    return 0;
  };
  int a1 = it1->first;
  int a2 = it2->first;
  int a3 = it3->first;
  if (a1 ^ a2 != a3) {
    cout << "No\n";
    return 0;
  };
  {
    cout << "Yes\n";
    return 0;
  };
  return 0;
}
