#include <bits/stdc++.h>
using namespace std;
struct work {
  long long int w;
  long long int t;
  bool operator<(const work &another) const { return t < another.t; }
};
int main() {
  long long int a, n, b[3];
  string ans = "Yes";
  map<long long int, long long int> map;
  long long int i, j;
  cin >> n;
  for (i = 0; i < (n); i++) {
    cin >> a;
    map[a]++;
  }
  if (map.size() != 3) {
    ans = "No";
  } else {
    if (n % 3 != 0) {
      ans = "No";
    } else {
      j = 0;
      for (auto itr = map.begin(); itr != map.end(); itr++) {
        b[j] = itr->first;
        j++;
      }
      b[1] ^= b[2];
      if (b[0] != b[1]) {
        ans = "No";
      }
    }
  }
  cout << ans << endl;
}
