#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);
  set<ll> st;
  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 {
    map<ll, ll> m;
    for (int i = 0; i < (n); ++i) {
      st.insert(a[i]);
      m[a[i]]++;
    }
    if (st.size() == 3) {
      vector<ll> b(3);
      int i = 0;
      for (auto x : st) {
        b[i] = x;
        ++i;
      }
      if (b[0] ^ b[1] ^ b[2] == 0 && m[b[0]] == m[b[1]] && m[b[1]] == m[b[2]] &&
          m[b[0]] == m[b[2]]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (st.size() == 2) {
      vector<ll> b(2);
      int i = 0;
      for (auto x : st) {
        b[i] = x;
        ++i;
      }
      if ((b[0] == 0 && m[b[0]] * 2 == m[b[1]]) ||
          (b[1] == 0 && m[b[1]] * 2 == m[b[0]])) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (st.size() == 1) {
      ll b;
      for (auto x : st) {
        b = x;
      }
      if (b == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
