#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<int64_t> data = {a[0]};
  int cou = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] != a[i + 1]) {
      cou++;
      data.push_back(a[i + 1]);
    }
    if (cou > 2) {
      break;
    }
  }
  if (cou == 2) {
    if (data[0] ^ data[1] == data[2] && data[0] ^ data[2] == data[1] &&
        data[1] ^ data[2] == data[0]) {
      if ((count(a.begin(), a.end(), data[0]) ==
           count(a.begin(), a.end(), data[1])) &&
          (count(a.begin(), a.end(), data[0]) ==
           count(a.begin(), a.end(), data[2]))) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    } else {
      cout << "No";
    }
  } else if (cou > 2) {
    cout << "No";
  } else if (cou == 0) {
    if (data[0] == 0) {
      cout << "Yes";
    } else {
      cout << "No";
    }
  } else if (cou == 1) {
    if (data[0] == 0) {
      if ((count(a.begin(), a.end(), data[0])) * 2 ==
          count(a.begin(), a.end(), data[1])) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    } else if (data[1] == 0) {
      if ((count(a.begin(), a.end(), data[1])) * 2 ==
          count(a.begin(), a.end(), data[0])) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    } else {
      cout << "No";
    }
  }
}
