#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  map<int, int> hist;
  set<int> ast;
  for (int i = 0; i < n; ++i) {
    int ai;
    cin >> ai;
    ast.insert(ai);
    hist[ai]++;
  }
  vector<int> a(ast.begin(), ast.end());
  bool ans = true;
  int last = -1, k = -1, l;
  switch (hist.size()) {
    case 1:
      ans = a[0] == 0;
      break;
    case 2:
      k = hist[a[0]];
      l = hist[a[1]];
      if (k <= l) {
        ans = (k * 2 == l) && (a[0] == 0);
      } else {
        ans = (l * 2 == k) && (a[1] == 0);
      }
      break;
    case 3:
      for (auto entry : hist) {
        if (last != -1 && entry.second != last) ans = false;
        last = entry.second;
      }
      ans = ((a[0] ^ a[1]) == a[2]) && ((a[0] ^ a[2]) == a[1]) &&
            ((a[1] ^ a[2]) == a[0]);
      break;
    default:
      ans = false;
      break;
  }
  cout << (ans ? "Yes" : "No") << endl;
}
