#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < 20; j++) {
      a[i] -= j;
      if (a[i] < 0) {
        a[i] = j - 1;
        break;
      }
    }
  }
  int xr = 0;
  for (int i = 0; i < n; i++) {
    xr ^= a[i];
  }
  if (xr == 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
