#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]++;
  }
  switch (map.size()) {
    case 1:
      if (map.begin()->first != 0) {
        ans = "No";
      }
      break;
    case 2:
      if (n % 3 != 0) {
        ans = "No";
      } else {
        if (map[0] != n / 3) {
          ans = "No";
        }
      }
      break;
    case 3:
      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";
        }
      }
      break;
    default:
      ans = "No";
      break;
  }
  cout << ans << endl;
}
