#include <bits/stdc++.h>
using namespace std;
int N;
long long a[100001];
long long b[100001];
long long c[100001];
long long ch[100001];
int main() {
  cin >> N;
  map<long long, int> m;
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  int cc = 0;
  for (auto it : m) {
    b[cc] = it.first;
    c[cc] = it.second;
    cc++;
  }
  if (cc > 4) {
    cout << "No" << endl;
  } else {
    for (int i = 0; i < (cc); i++) {
      for (int j = 0; j < (cc); j++) {
        for (int k = 0; k < (cc); k++) {
          ch[k] = c[k];
        }
        long long now = b[i];
        long long now2 = b[j];
        ch[i]--;
        ch[j]--;
        for (int k = 0; k < (N - 2); k++) {
          long long nxt = now ^ now2;
          ch[nxt]--;
          now = now2;
          now2 = nxt;
        }
        bool c = false;
        for (int k = 0; k < (cc); k++) {
          if (ch[k] != 0) c = true;
        }
        if (c == false) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
    cout << "No" << endl;
  }
  return 0;
}
