#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[100001];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  if (n > 3) {
    if (a[n - 1] == 0) {
      cout << "Yes";
    } else {
      if (n % 3 != 0) {
        cout << "No";
      } else {
        map<int, int> m;
        set<int> s1;
        for (int i = 0; i < n; i++) {
          s1.insert(a[i]);
          m[a[i]]++;
        }
        int count = s1.size();
        if (count != 3) {
          cout << "No";
        } else {
          int num[3];
          int j = 0;
          for (auto i : m) {
            num[j] = i.first;
            j++;
          }
          if (m[num[0]] == m[num[1]] and m[num[1]] == m[num[2]]) {
            if ((num[0] ^ num[1]) == (num[2]) and
                (num[0] ^ num[2]) == (num[1]) and
                (num[2] ^ num[1]) == (num[0])) {
              cout << "Yes";
            } else {
              cout << "No";
            }
          } else {
            cout << "No";
          }
        }
      }
    }
  } else {
    if ((a[0] ^ a[1]) == (a[2]) and (a[0] ^ a[2]) == (a[1]) and
        (a[2] ^ a[1]) == (a[0])) {
      cout << "Yes";
    } else {
      cout << "No";
    }
  }
  return 0;
}
