#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
unordered_map<int, int> s;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n % 3) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    int cur;
    cin >> cur;
    ++s[cur];
  }
  if (s.size() == 1) {
    if (s.begin()->first == 0)
      cout << "Yes";
    else
      cout << "No";
  } else if (s.size() == 2) {
    if (s.count(0) && s[0] == n / 3)
      cout << "Yes";
    else
      cout << "No";
  } else if (s.size() == 3) {
    int tot = 0;
    for (auto e : s) a[tot++] = e.first;
    if (s[a[0]] == s[a[1]] && s[a[0]] == s[a[2]] && (a[0] ^ a[1]) == a[2] &&
        (a[1] ^ a[2]) == a[0] && (a[0] ^ a[2]) == a[1])
      cout << "Yes";
    else
      cout << "No";
  } else
    cout << "No";
  return 0;
}
