#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<LL, LL>;
using VI = vector<int>;
using VVI = vector<VI>;
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;
}
void solve() {
  int N;
  int a[4], c[3];
  int count = -1;
  cin >> N;
  for (int i = 0; i < (3); ++i) {
    c[i] = 0;
    a[i] = -1;
  }
  for (int i = 0; i < (N); ++i) {
    int tmp;
    cin >> tmp;
    bool new_a = 1;
    for (int j = 0; j < (3); ++j) {
      ;
      if (tmp == a[j]) {
        ++c[j];
        new_a = 0;
      }
    }
    if (new_a) ++count;
    ;
    if (new_a) a[count] = tmp;
    ;
    if (count == 3) {
      cout << "No" << endl;
      return;
    }
  };
  ;
  ;
  ;
  ;
  ;
  int test;
  test = a[0] ^ a[1];
  ;
  if (c[0] == c[1] && c[1] == c[2] && test == a[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
int main() {
  int T = 1;
  for (int i = 0; i < T; ++i) {
    solve();
  }
}
