#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  vector<long long> a;
  vector<long long> b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long _a;
    cin >> _a;
    a.push_back(_a);
    b.push_back(_a);
  }
  std::sort(b.begin(), b.end());
  b.erase(std::unique(b.begin(), b.end()), b.end());
  int cnt = b.size();
  if (cnt == 1) {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] > 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cnt == 2) {
    long x = b[0];
    long y = b[1];
    long z = x ^ y;
    if (z != 0 || n % 2 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      int cnt_x = 0;
      int cnt_y = 0;
      for (int i = 0; i < n; i++) {
        if (a[i] == b[0]) cnt_x++;
        if (a[i] == b[1]) cnt_y++;
      }
      if (cnt_x == (n / 2)) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  return 0;
}
