#include <bits/stdc++.h>
using namespace std;
int sum(const map<int64_t, int>& m) {
  int c = 0;
  for (auto&& kv : m) {
    c += kv.second;
  }
  return c;
}
bool check_key(const map<int64_t, int>& m) {
  vector<int64_t> v;
  for (auto&& kv : m) {
    v.push_back(kv.first);
  }
  int64_t x = v[0] ^ v[1] ^ v[2];
  return x == 0 && v[0] != v[1] && v[1] != v[2] && v[2] != v[0];
}
int main() {
  int N;
  cin >> N;
  map<int64_t, int> m;
  for (int i = 0; i < N; ++i) {
    int64_t k;
    cin >> k;
    m[k] += 1;
  }
  bool result = false;
  if (m.size() == 1 && m[0] == N) {
    result = true;
  } else if (m.size() == 2 && sum(m) == N) {
    result = true;
  } else if (m.size() == 3 && sum(m) == N && check_key(m)) {
    result = true;
  }
  cout << (result ? "Yes" : "No") << endl;
}
