#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool all_true = true;
  for (int i = 0; i < (n - 1); ++i) {
    if (a[i] != a[i + 1]) all_true = false;
  }
  if (all_true) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n == 3) {
    if (a[0] xor a[1] == a[2])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  map<int, int> m;
  for (int i = 0; i < (n); ++i) {
    if (m.find(a[i]) == m.end())
      m.insert(make_pair(a[i], 1));
    else
      m[a[i]]++;
  }
  map<int, int>::iterator ite;
  vector<int> memo;
  int cnt = 0;
  for (ite = m.begin(); ite != m.end(); ++ite) {
    if (cnt == 0) {
      cnt = ite->second;
    } else {
      if (cnt != ite->second) {
        cout << "No" << endl;
        return 0;
      }
    }
    memo.push_back(ite->first);
  }
  if (memo.size() == 3) {
    if (memo[0] xor memo[1] == memo[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
