#include <bits/stdc++.h>   using namespace std;   const int64_t INF = INT64_MAX / 4;   const int64_t NINF = -INF;   map<pair<int64_t, uint32_t>, int64_t> dp;   int64_t grundy(int64_t pile, uint32_t pattern) {     if (pile == 0) {       return 0;     }     pair<int64_t, uint32_t> key = {pile, pattern};     auto fd = dp.find(key);     if (fd != dp.end()) {       return fd->second;     }     bitset<32> bs(pattern);     set<int64_t> res;     for (int64_t i = 0; i < pile; i++) {       if (!bs[i]) {         bs[i] = true;         res.insert(grundy(pile - (i + 1), bs.to_ulong()));         bs[i] = false;       }     }     int64_t ans = 0;     while (res.find(ans) != res.end()) {       ans++;     }     dp.insert({key, ans});     return ans;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int64_t n;     cin >> n;     int64_t ans = 0;     for (int64_t i = 0; i < n; i++) {       int64_t pile;       cin >> pile;       ans ^= grundy(pile, 0);     };     if (ans == 0) {       cout <<  YES ;     } else {       cout <<  NO ;     }     return 0;   }   