#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<int> a(n);
  set<int> s;
  multiset<int> ms;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
    ms.insert(a[i]);
  }

  if (all_of(begin(a), end(a), [](auto a){return a == 0;})) {
    cout << "Yes" << endl;
    return 0;
  }

  if (s.size() > 3 || n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }

  if (s.size() == 2) {
    if (int(ms.count(0)) == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }

  if (s.size() == 3) {
    int x = 0;
    for (auto&& e : s) {
      x ^= e;
    }
    if (x != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      for (auto&& e : ms) {
        if (int(ms.count(e)) != n / 3) {
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
