#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;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    map<ll, int> m;
    stack<ll> st;
    int count = 0;
    for (int i = 0; i < (n); ++i) {
      if (m[a[i]] == 0) {
        count++;
        st.push(a[i]);
      }
      m[a[i]]++;
    }
    if (count > 3) {
      cout << "No" << endl;
      return 0;
    }
    if (st.size() == 1) {
      if (m[st.top()] == n && st.top() == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (st.size() == 2) {
      int num = st.top();
      st.pop();
      int num_2 = st.top();
      if (m[num] > m[num_2]) {
        if (m[num] == m[num_2] * 2) {
          if (num == 0) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        } else {
          cout << "No" << endl;
        }
      } else if (m[num] * 2 == m[num_2]) {
        if (num_2 == 0) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    } else {
      ll num_1, num_2, num_3;
      num_1 = st.top();
      st.pop();
      num_2 = st.top();
      st.pop();
      num_3 = st.top();
      st.pop();
      if (m[num_1] == m[num_2] && m[num_2] == m[num_3]) {
        if (num_1 ^ num_2 == num_3 || num_2 ^ num_3 == num_1 ||
            num_1 ^ num_3 == num_2) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    }
  }
}
