#include <bits/stdc++.h>
using namespace std;
void preprocess(void) { return; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int n;
  cin >> n;
  vector<int> ar(n);
  for (auto i = (0); i < n; i++) cin >> ar[i];
  set<int> st(ar.begin(), ar.end());
  if ((int)(st).size() == 3) {
    vector<int> br(st.begin(), st.end());
    if ((br[0] ^ br[1]) != br[2]) {
      cout << "No" << endl;
      return 0;
    }
    vector<int> cnt(3);
    for (auto i = (0); i < n; i++) {
      for (auto j = (0); j < 3; j++) {
        if (br[j] == ar[i]) cnt[j]++;
      }
    }
    if (cnt[0] == cnt[1] && cnt[1] == cnt[2]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
