#include <bits/stdc++.h>
using namespace std;
int n, cnt;
int a[100010];
vector<int> v;
map<int, int> mp;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (mp[a[i]] == 1) {
      cnt++;
      v.push_back(a[i]);
    }
  }
  if (cnt != 3)
    cout << "No" << endl;
  else {
    if (mp[v[0]] == mp[v[1]] && mp[v[1]] == mp[v[2]] && v[0] ^ v[2] == v[1] &&
        v[1] ^ v[0] == v[2] && v[1] ^ v[2] == v[0]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
