#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n, a;
  cin >> n;
  map<long long, long long> m;
  for (long long i = 0; i < n; ++i) {
    cin >> a;
    m[a] += 1;
  }
  if (m.size() == 1) {
    if (m.begin()->first == 0)
      puts("Yes");
    else
      puts("No");
  } else if (m.size() == 2) {
    if (m.begin()->first == 0 && n % 3 == 0 && m.begin()->second == n / 3)
      puts("Yes");
    else
      puts("No");
  } else if (m.size() == 3) {
    vector<long long> keys(3);
    long long pos = 0;
    for (auto itr = m.begin(); itr != m.end(); ++itr) {
      keys[pos] = itr->first;
      pos += 1;
    }
    bool b1 = (keys[0] ^ keys[1] == keys[2]);
    bool b2 = (m[keys[0]] == m[keys[1]] && m[keys[1]] == m[keys[2]]);
    if (b1 && b2)
      puts("Yes");
    else
      puts("No");
  } else
    puts("No");
  return 0;
}
