#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 mt(736);
void solve(istream &cin = std::cin, ostream &cout = std::cout) {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (auto &it : arr) cin >> it;
  set<int> types(arr.begin(), arr.end());
  if (types.size() == 1) {
    cout << ((*types.begin()) == 0 ? "Yes" : "No") << endl;
    return;
  }
  if (n % 3 == 0) {
    int x = 0;
    for (auto it : types) x ^= it;
    if (x == 0 && types.size() == 3 &&
        count(arr.begin(), arr.end(), *types.begin()) == n / 3 &&
        count(arr.begin(), arr.end(), *types.rbegin()) == n / 3) {
      cout << "Yes" << endl;
      return;
    }
  }
  cout << "No" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  solve();
  return 0;
}
