#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> x;
  for (int i = 0, tmp; i < n; i++) {
    cin >> tmp;
    if (x.end() == x.find(tmp)) {
      x.insert(make_pair(tmp, 1));
    } else {
      x.at(tmp)++;
    }
  }
  string ans;
  if (x.size() > 3) {
    ans = "No";
  } else if (x.find(0) == x.end()) {
    if (x.size() != 1) {
      ans = "No";
    } else {
      int count = 0, first = 0, second = 0;
      ans = "Yes";
      for (const auto &s : x) {
        if (count == 0) {
          count = s.second;
          first = s.first;
        } else if (count != s.second) {
          ans = "No";
          break;
        } else if (second == 0) {
          second = s.first;
        } else if ((first ^ second) != s.first) {
          ans = "No";
          break;
        }
      }
    }
  } else {
    if (x.size() == 1) {
      ans = "Yes";
    } else {
      if (x.size() == 2) {
        int tmp = 0;
        for (const auto &s : x) {
          if (tmp == 0) {
            tmp = s.second;
          } else if (s.second / tmp == 2 && s.second % tmp == 0) {
            ans = "Yes";
          } else {
            ans = "No";
          }
        }
      } else {
        ans = "No";
      }
    }
  }
  cout << ans << endl;
}
