#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graf = vector<vector<int>>;
using Graf_bool = vector<vector<bool>>;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  if (n % 3 != 0) {
    for (int i = 0; i < (n); ++i)
      if (a[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
    cout << "Yes" << endl;
    return 0;
  } else {
    queue<ll> q;
    map<ll, ll> m;
    for (int i = 0; i < (n); ++i) {
      if (m[a[i]] == 0) {
        q.push(a[i]);
      }
      m[a[i]]++;
    }
    if (q.size() == 3) {
      ll b, c, d;
      b = q.front();
      q.pop();
      c = q.front();
      q.pop();
      d = q.front();
      if (b ^ c ^ d == 0 && m[b] == m[c] && m[c] == m[d] && m[b] == m[d]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (q.size() == 2) {
      ll b, c;
      b = q.front();
      q.pop();
      c = q.front();
      if ((b == 0 && m[b] / 2 * 3 == n) || (c == 0 && m[c] / 2 * 3 == n)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (q.size() == 1) {
      ll b = q.front();
      if (b == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
