#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  if (count(a.begin(), a.end(), 0) == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (auto x : a) mp[x]++;
  if (mp.size() == 2) {
    int x = mp.begin()->second;
    int y = next(mp.begin())->second;
    if (x < y) swap(x, y);
    if (x % 3 == 0 && y % 3 == 0 && x == N / 3 * 2 && y == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  } else if (mp.size() == 3) {
    bool good = true;
    for (auto x : mp)
      if (x.second != N / 3) good = false;
    int z = 0;
    for (auto x : mp) z ^= x.first;
    if (good && z == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
