#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
int a[100000];
map<int, int> m;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  auto it = m.find(0);
  if (it != m.end()) {
    if (m.size() == 1) return cout << "Yes", 0;
    if (m.size() == 2 && it->second == n / 2) return cout << "Yes", 0;
    return cout << "No", 0;
  }
  if (n % 3 != 0 || m.size() != 3) return cout << "No", 0;
  int x = 0;
  for (pair<int, int> p : m) {
    x ^= p.first;
    if (p.second != n / 3) return cout << "No", 0;
  }
  if (x != 0) return cout << "No", 0;
  cout << "Yes";
}
