#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (long long i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 1 && mp[0] > 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (mp.size() == 2) {
    int key = 0;
    bool suc1 = 0;
    bool suc2 = 0;
    for (auto p : mp) {
      if (key == 0 && p.second == n / 3) {
        suc1 = 1;
      }
      if (key == 1 && p.second == 2 * n / 3) {
        suc2 = 1;
      }
      key++;
    }
    if (suc1 && suc2) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 3) {
    for (auto p : mp) {
      if (p.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    int a, b, c;
    int key = 0;
    for (auto p : mp) {
      if (key == 0) a = p.first;
      if (key == 1) b = p.first;
      if (key == 2) c = p.first;
      key++;
    }
    if ((a ^ b) == c) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
