#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    m[num]++;
  }
  if (m.size() == 3) {
    for (auto itr : m) {
      if (itr.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    int res = 0;
    for (auto itr : m) {
      res ^ itr.first;
    }
    if (res == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (m.size() == 2) {
    if (m[0] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else if (m.size() == 1) {
    if (m[0]) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
}
