#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
bool dfs(int a0, int a1, int l, int m, const set<int> &st) {
  if (st.empty()) {
    return m == (l ^ a0) && a0 == (m ^ a1);
  }
  set<int> copy = st;
  for (auto &r : st) {
    if (m == (l ^ r)) {
      copy.erase(r);
      if (dfs(a0, a1, m, r, copy)) return true;
      copy.insert(r);
    }
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> mp;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  bool yes = false;
  if ((int)mp.size() == 1 && a[0] == 0) {
    yes = true;
  } else if ((int)mp.size() == 2 && N % 3 == 0 && mp[0] == N / 3) {
    yes = true;
  } else if ((int)mp.size() == 3 && N % 3 == 0) {
    bool tmp = true;
    for (auto &p : mp) {
      tmp = tmp && (p.second == N / 3);
    }
    yes = tmp;
  }
  if (yes)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
