#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> mas(n);
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> mas[i];
    ++mp[mas[i]];
  }
  if (mp.size() == 1 && mp.begin()->first == 0)
    cout << "Yes\n";
  else if (!n % 3 || mp.size() != 3)
    cout << "No\n";
  else {
    int xr = 0;
    for (auto p : mp) {
      if (p.second != n / 3) {
        xr = 1;
        break;
      }
      xr = xr ^ p.first;
    }
    if (xr)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
