#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  int n;
  cin >> n;
  int a[n];
  map<int, int> mp;
  bool all0 = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) all0 = false;
    mp[a[i]]++;
  }
  if (n % 3 == 0) {
    if (mp.size() >= 4) {
      cout << "No" << endl;
    } else if (mp.size() == 3) {
      int x[3];
      int cnt = 0;
      for (auto i : mp) {
        x[cnt] = i.first;
        cnt++;
      }
      if ((x[0] ^ x[1]) == x[2])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (mp.size() == 2) {
      bool f1 = false;
      bool f2 = false;
      for (auto i : mp) {
        if (i.first == 0 && i.second == n / 3) f1 = true;
        if (i.second == n * 2 / 3) f2 = true;
      }
      if (f1 && f2)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else {
      if (all0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  } else {
    if (all0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
