#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graf = vector<vector<int>>;
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;
        break;
      }
    }
    cout << "Yes" << endl;
  } else {
    sort((a).begin(), (a).end());
    queue<ll> q;
    map<ll, ll> m;
    ll num;
    num = a[0];
    q.push(num);
    for (int i = 0; i < (n); ++i) {
      m[a[i]]++;
      if (a[i] != num) {
        q.push(a[i]);
        num = a[i];
      }
    }
    if (q.size() == 1) {
      if (q.front() == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (q.size() == 2) {
      ll c = q.front();
      q.pop();
      ll d = q.front();
      q.pop();
      if (3 * m[c] == 2 * n && d == 0 || 3 * m[d] == 2 * n && c == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (q.size() == 3) {
      ll c = q.front();
      q.pop();
      ll d = q.front();
      q.pop();
      ll e = q.front();
      q.pop();
      if (m[c] == m[d] && m[d] == m[e] && c ^ d ^ e == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
