/* Rishabh Arora
   IIIT-Hyderabad */

#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> II;
typedef vector<int> VI;
typedef vector<II> VII;
typedef long long int LL;
typedef unsigned long long int ULL;

#define rep(i, a, b) for(i = a; i < b; i++)
#define rev(i, a, b) for(i = a; i > b; i--)
#define INF INT_MAX
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SET(a,b) memset(a, b, sizeof(a))

//debugging statements
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const int N = 1e5+10;
const int mod = 1e9+7;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  int x = 0;

  int s[1000];
  int j = 1;
  int i = 0;

  while(i <= 60) {
  	for(int k = 1; k <= j; k++) {
  		s[i] = j-1;
  		i++;
  	}
  	j++;
  }

  for(int i = 1; i <= n; i++) {
  	int y;
  	cin >> y;
  	x ^= s[y];
  }
  if (x == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


/* Rishabh Arora
   IIIT-Hyderabad */

#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> II;
typedef vector<int> VI;
typedef vector<II> VII;
typedef long long int LL;
typedef unsigned long long int ULL;

#define rep(i, a, b) for(i = a; i < b; i++)
#define rev(i, a, b) for(i = a; i > b; i--)
#define INF INT_MAX
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SET(a,b) memset(a, b, sizeof(a))

//debugging statements
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const int N = 1e5+10;
const int mod = 1e9+7;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  int x = 0;

  int s[100];
  int j = 1;
  int i = 0;

  while(i <= 60) {
  	for(int k = 1; k <= j; k++) {
  		s[i] = j;
  		i++;
  	}
  	j++;
  }

  for(int i = 1; i <= n; i++) {
  	int y;
  	cin >> y;
  	x ^= s[y];
  }
  if (x == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


/* Rishabh Arora
   IIIT-Hyderabad */

#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> II;
typedef vector<int> VI;
typedef vector<II> VII;
typedef long long int LL;
typedef unsigned long long int ULL;

#define rep(i, a, b) for(i = a; i < b; i++)
#define rev(i, a, b) for(i = a; i > b; i--)
#define INF INT_MAX
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SET(a,b) memset(a, b, sizeof(a))

//debugging statements
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const int N = 1e5+10;
const int mod = 1e9+7;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  int x = 0;

  int s[1000];
  int j = 1;
  int i = 1;

  s[0] = 0;
  while(i <= 60) {
  	for(int k = 1; k <= j; k++) {
  		s[i] = j;
  		i++;
  	}
  	j++;
  }

  for(int i = 1; i <= n; i++) {
  	int y;
  	cin >> y;
  	x ^= s[y];
  }
  if (x == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


#include<iostream>
#include<cstdio>
using namespace std;

int n,ans;

int main()
{
    int i,j,p;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        scanf("%d",&p);
        for(j=1;j*(j+1)/2<=p;j++);
        ans^=j-1;
    }
    ans?puts("NO"):puts("YES");
}


#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
#define ls i<<1
#define rs ls | 1
#define mid ((ll+rr)>>1)
#define pii pair<LL,int>
#define MP make_pair
typedef long long LL;
const long long INF = 1e18;
const double Pi = acos(-1.0);
const int N = 1e6+10, maxn = 1e3+20, mod = 1e9+7, inf = 2e9;

map<LL,int > dp[N];
int sg[N],n;
int dfs(int x,LL dep) {
    if(dp[x].count(dep)) return dp[x][dep];
    LL ret = 0;
    for(int i = 0; i < x; ++i) {
        if(((dep>>i)&1) == 0) {
            ret |= 1<<(dfs(x-i-1,dep|(1<<i)));
        }
    }
    for(int i = 0; i < 60; ++i) {
        if((ret>>i&1) == 0) {
            dp[x][dep] = i;
            break;
        }
    }
    return dp[x][dep];
}
int main() {
    for(int i = 1; i <= 60; ++i) sg[i] = dfs(i,0);
    scanf("%d",&n);
    int ans = 0;
    for(int i = 1; i <= n; ++i) {
        int x;
        scanf("%d",&x);
        ans ^= sg[x];
    }
    if(!ans) puts("YES");
    else puts("NO");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<map>
#define ll long long
#define mp(a,b) make_pair(a,b)
using namespace std;
map<pair<ll,int>,int> dp;
int sg[100],ans=0,x,n;
int dfs(int num, int dep)
{
	if(!num) return 0;	dep&=(1ll<<(num+1))-1;
	if(dp.count(mp(num,dep))) return dp[mp(num,dep)];
	int ret=0,res=0;
	for(int i=1;i<=num;i++)		if(dep^(1ll<<i)) ret|=1ll<<dfs(num-i,dep^(1ll<<i));
	while(ret&1) ret>>=1,res++;
	dp[mp(num,dep)]=res; return res;
}
int main()
{

	for(int i=1;i<=60;i++) sg[i]=dfs(i,0);	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&x),ans^=sg[x];
	if(ans) printf("NO");	else printf("YES");
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

typedef map<ll,ll> M;
#define MEM(a, b) memset(a, (b), sizeof(a)) //fill value
#define FI(i, j, k, in) for (int i=j ; i<k ; i+=in) //from j till k increment by in FOR INT
#define fl(i, j, k, in) for (long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR LL
#define fll(i, j, k) for (long long int i=j ; i<k ; i+=1) //from j till k increment by in FOR LL
#define FULL(i, j, k, in) for (unsigned long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR ULL
ll mod=pow(10,9)+7;
ll inf=pow(10,18)+16;
map<pair<ll,ll>,ll> par;
#define N 62

ll recur(ll n,ll mask)
{
    if(n==0 && mask==0)
    return 0;

    if(par.count(make_pair(n,mask)))
    return par[make_pair(n,mask)];

    bool mexOfmex[N];
    memset(mexOfmex,false,sizeof(mexOfmex));
    fll(i,0,n)
    {
        if(n&(1ll<<i))
        {
            mexOfmex[recur(n-(i+1),mask^(1ll<<i))]=true;
        }
    }
    ll res;
    fll(i,0,n+2)
    {
        if(mexOfmex[i]==false)
        {
            res=i;
            break;
        }
    }
    par[make_pair(n,mask)]=res;
    return res;
}

int main() {

	// your code here
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll n;
	cin>>n;

	ll arr[1000005];
	fll(i,0,n)
	cin>>arr[i];

    ll val[62];
    fll(i,1,61)
    val[i]=recur(i,(1ll<<i)-1);

    ll res=0;
    fll(i,0,n)
    res^=val[arr[i]];

    if(res)
    cout<<"NO"<<endl;
    else
    cout<<"YES"<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

typedef map<ll,ll> M;
#define MEM(a, b) memset(a, (b), sizeof(a)) //fill value
#define FI(i, j, k, in) for (int i=j ; i<k ; i+=in) //from j till k increment by in FOR INT
#define fl(i, j, k, in) for (long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR LL
#define fll(i, j, k) for (long long int i=j ; i<k ; i+=1) //from j till k increment by in FOR LL
#define FULL(i, j, k, in) for (unsigned long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR ULL
ll mod=pow(10,9)+7;
ll inf=pow(10,18)+16;
map<pair<ll,ll>,ll> par;
#define N 62

ll recur(ll n,ll mask)
{
    if(n==0 && mask==0)
    return 0;

    if(par.count(make_pair(n,mask)))
    return par[make_pair(n,mask)];

    bool mexOfmex[N];
    memset(mexOfmex,false,sizeof(mexOfmex));
    fll(i,0,n)
    {
        if(n&(1<<i))
        {
            mexOfmex[recur(n-(i+1),mask^(1<<i))]=true;
        }
    }
    ll res;
    fll(i,0,n+2)
    {
        if(mexOfmex[i]==false)
        {
            res=i;
            break;
        }
    }
    par[make_pair(n,mask)]=res;
    return res;
}

int main() {

	// your code here
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll n;
	cin>>n;

	ll arr[1000005];
	fll(i,0,n)
	cin>>arr[i];

    ll val[62];
    fll(i,1,61)
    val[i]=recur(i,(1ll<<i)-1);

    ll res=0;
    fll(i,0,n)
    res^=val[arr[i]];

    if(res)
    cout<<"NO"<<endl;
    else
    cout<<"YES"<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

typedef map<ll,ll> M;
#define MEM(a, b) memset(a, (b), sizeof(a)) //fill value
#define FI(i, j, k, in) for (int i=j ; i<k ; i+=in) //from j till k increment by in FOR INT
#define fl(i, j, k, in) for (long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR LL
#define fll(i, j, k) for (long long int i=j ; i<k ; i+=1) //from j till k increment by in FOR LL
#define FULL(i, j, k, in) for (unsigned long long int i=j ; i<k ; i+=in) //from j till k increment by in FOR ULL
ll mod=pow(10,9)+7;
ll inf=pow(10,18)+16;
map<pair<ll,ll>,ll> par;
#define N 62

ll recur(ll n,ll mask)
{
    if(n==0 && mask==0)
    return 0;

    if(par.count(make_pair(n,mask)))
    return par[make_pair(n,mask)];

    bool mexOfmex[N];
    memset(mexOfmex,false,sizeof(mexOfmex));
    fll(i,0,n)
    {
        if(mask&(1ll<<i))
        {
            mexOfmex[recur(n-(i+1),mask^(1ll<<i))]=true;
        }
    }
    ll res;
    fll(i,0,N+2)
    {
        if(mexOfmex[i]==false)
        {
            res=i;
            break;
        }
    }
    par[make_pair(n,mask)]=res;
    return res;
}

int main() {

	// your code here
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll n;
	cin>>n;

	ll arr[1000005];
	fll(i,0,n)
	cin>>arr[i];

    ll val[62];
    fll(i,1,61)
    {
        val[i]=recur(i,(1ll<<i)-1);
        //cout<<val[i]<<endl;
    }

    ll res=0;
    fll(i,0,n)
    res^=val[arr[i]];

    if(res)
    cout<<"NO"<<endl;
    else
    cout<<"YES"<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define endl '\n'

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(15);
}
int grundy[62] ;
int main(int argc,char* argv[]) {
    io() ;
    #ifndef ONLINE_JUDGE
        freopen("inp.txt", "r", stdin) ;
        // freopen("out.txt", "w", stdout);
    #endif
    for(int i = 1 ; i <= 60 ; i++){
        int val = 0 ;
        int j ;
        for(j = 1 ; j <= 11 ; j++){
            if(val < i){
                val += j ;
            }
            else{
                break ;
            }
        }
        j-- ;
        grundy[i] = j ;
    }
    int n ;
    cin >> n ;
    int x ;
    int ans = 0 ;
    while(n--){
        cin >> x ;
        ans ^= grundy[x];
    }
    if(ans == 0) cout << "YES\n" ;
    else cout << "NO\n" ;
    return 0 ;
}


#include <bits/stdc++.h>
using namespace std;

#define endl '\n'

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(15);
}
int grundy[62] ;
int main(int argc,char* argv[]) {
    io() ;
    #ifndef ONLINE_JUDGE
        freopen("inp.txt", "r", stdin) ;
        // freopen("out.txt", "w", stdout);
    #endif
    for(int i = 1 ; i <= 60 ; i++){
        int val = 0 ;
        int j ;
        for(j = 1 ; j <= 11 ; j++){
            if(val <= i){
                val += j ;
            }
            else{
                break ;
            }
        }
        j-- ;
        grundy[i] = j ;
    }
    int n ;
    cin >> n ;
    int x ;
    int ans = 0 ;
    while(n--){
        cin >> x ;
        ans ^= grundy[x];
    }
    if(ans == 0) cout << "YES\n" ;
    else cout << "NO\n" ;
    return 0 ;
}


#include <bits/stdc++.h>
using namespace std;

#define endl '\n'

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(15);
}
int grundy[62] ;
int main(int argc,char* argv[]) {
    io() ;
    #ifndef ONLINE_JUDGE
        freopen("inp.txt", "r", stdin) ;
        // freopen("out.txt", "w", stdout);
    #endif
    for(int i = 1 ; i <= 60 ; i++){
        int val = 0 ;
        int j ;
        for(j = 1 ; j <= 12 ; j++){
            if(val < i){
                val += j ;
            }
            else{
                break ;
            }
        }
        if(val > i)
            j-- ;
        grundy[i] = j ;
    }
    int n ;
    cin >> n ;
    int x ;
    int ans = 0 ;
    while(n--){
        cin >> x ;
        ans ^= grundy[x];
    }
    if(ans == 0) cout << "YES\n" ;
    else cout << "NO\n" ;
    return 0 ;
}


#include <bits/stdc++.h>
using namespace std;

#define endl '\n'

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(15);
}
int grundy[62] ;
int main(int argc,char* argv[]) {
    io() ;
    #ifndef ONLINE_JUDGE
        freopen("inp.txt", "r", stdin) ;
        // freopen("out.txt", "w", stdout);
    #endif
    for(int i = 1 ; i <= 60 ; i++){
        int val = 0 ;
        int j ;
        for(j = 1 ; j <= 11 ; j++){
            if((val + j) <= i) val += j ;
            else {
                j-- ;
                break ;
            }
        }
        grundy[i] = j ;
    }

    int n ;
    cin >> n ;
    int x ;
    int ans = 0 ;
    while(n--){
        cin >> x ;
        ans ^= grundy[x];
    }
    if(ans == 0) cout << "YES\n" ;
    else cout << "NO\n" ;
    return 0 ;
}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;

using PII = pair<int, int>;
using TI3 = tuple<int, int, int>;
using LL = long long;
using ULL = unsigned long long;
using MAT = array<array<LL, 2>, 2>;

template<class T> constexpr inline T begin(const T&) {return 0;}
template<class T> constexpr inline T end(const T& x) {return x;}

#define PN() putchar('\n')
#define PB push_back
#define EB emplace_back
#define GET_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define CHECK(a,b) static_assert(std::is_same<decltype(a), decltype(b)>::value, "REP diff types");

#define REPPP(i,s,c,t) for(i; ((s) and (c)) or (putchar("\n "[c]) and (c)); (t))
#define REPP2(i,n) REPPP(auto i=begin(n),i==begin(n),i!=end(n),++i)
#define REPP3(i,m,n) CHECK(m,n) REPPP(auto i=(m),i==(m),i<(n),++i)
#define REPP4(i,m,n,s) CHECK(m,n) REPPP(auto i=(m),i==(m),((s)>0 and i<(n)) or ((s)<0 and i>(n)),i+=(s))
#define REPP(...) GET_MACRO(__VA_ARGS__, REPP4, REPP3, REPP2)(__VA_ARGS__)

#define REP2(i,n) for(auto i=begin(n);i!=end(n);++i)
#define REP3(i,m,n) CHECK(m,n) for(auto i=(m);i<(n);++i)
#define REP4(i,m,n,s) CHECK(m,n) for(auto i=(m);((s)>0 and i<(n)) or ((s)<0 and i>(n));i+=(s))
#define REP(...) GET_MACRO(__VA_ARGS__, REP4, REP3, REP2)(__VA_ARGS__)

template<class T> void _read(T &x) {cin>>x;}
void _read(size_t &x) {scanf("%zu", &x);}
void _read(int &x) {scanf("%d", &x);}
void _read(LL &x) {scanf("%lld", &x);}
void _read(ULL &x) {scanf("%llu", &x);}
void _read(double &x) {scanf("%lf", &x);}
void _read(char &x) {scanf(" %c", &x);}
void _read(char *x) {scanf("%s", x);}
void read() {}
template<class T, class... U>
void read(T& head, U&... tail) {
    _read(head);
    read(tail...);
}

template<class T> void _print(const T &x) {cout << x;}
void _print(const size_t &x) {printf("%zu", x);}
void _print(const int &x) {printf("%d", x);}
void _print(const LL &x) {printf("%lld", x);}
void _print(const ULL &x) {printf("%llu", x);}
void _print(const double &x) {printf("%.16lf",x);}
void _print(const char &x) {putchar(x);}
void _print(const char *x) {printf("%s",x);}
template<class T> void _print(const vector<T> &x) {
    for(auto i = x.begin(); i != x.end(); _print(*i++)) {
        if (i != x.cbegin()) putchar(' ');
    }
}
void print() {}
template<class T, class... U> void print(const T& head, const U&... tail) {
    _print(head);
    putchar(sizeof...(tail) ? ' ' : '\n');
    print(tail...);
}

#define LLINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f

const int MOD = 1000000007;
#define MAX_N 300005

map<pair<int, LL>, int> dp;

int grundyNumber(int k, LL used) {
    pair<int, LL> p = {k, used};
    auto ii = dp.find(p);
    if(ii != dp.end()) {
        return ii->second;
    }
    set<int> s;
    REP(i, 1, k + 1) {
        if(((1ULL << i) & used) == 0) {
            int sg = grundyNumber(k - i, (1ULL << i) | used);
            s.insert(sg);
        }
    }
    if(s.empty()) {
        dp[p] = 0;
        return 0;
    }
    int ret = 0;
    while(s.find(ret) != s.end()) {
        ++ret;
    }
    dp[p] = ret;
    return ret;
}

int main()
{
    int n, ans = 0;
    read(n);
    REP(i, n) {
        int x;
        read(x);
        ans ^= grundyNumber(x, 0);
    }
    if(ans == 0) {
        print("YES");
    } else {
        print("NO");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

using LL = long long;

size_t seed;

auto myhash = [](pair<int, LL> p)->size_t {
    size_t ret = seed;
    ret ^= p.first + 0x9e3779b9 + (ret << 6) + (ret >> 2);
    ret ^= p.second + 0x9e3779b9 + (ret << 6) + (ret >> 2);
    return ret;
};

unordered_map<pair<int, LL>, int, decltype(myhash)> dp(0, myhash);

int grundyNumber(int k, LL used) {
    pair<int, LL> p = {k, used};
    auto ii = dp.find(p);
    if(ii != dp.end()) {
        return ii->second;
    }
    set<int> s;
    for(int i = 1; i < k + 1; i++) {
        if(((1ULL << i) & used) == 0) {
            int sg = grundyNumber(k - i, (1ULL << i) | used);
            s.insert(sg);
        }
    }
    if(s.empty()) {
        dp[p] = 0;
        return 0;
    }
    int ret = 0;
    while(s.find(ret) != s.end()) {
        ++ret;
    }
    dp[p] = ret;
    return ret;
}

int main()
{
    srand(time(0));
    seed = rand();

    int n, y = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        y ^= grundyNumber(x, 0);
    }
    if(y == 0) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

using LL = long long;

size_t seed;

auto myhash = [](pair<int, LL> p)->size_t {
    size_t ret = seed;
    ret ^= p.first + 0x9e3779b9 + (ret << 6) + (ret >> 2);
    ret ^= p.second + 0x9e3779b9 + (ret << 6) + (ret >> 2);
    return ret;
};

unordered_map<pair<int, LL>, int, decltype(myhash)> dp(0, myhash);

int grundyNumber(int k, LL used) {
    pair<int, LL> p = {k, used};
    auto ii = dp.find(p);
    if(ii != dp.end()) {
        return ii->second;
    }
    set<int> s;
    for(int i = 1; i < k + 1; i++) {
        if(((1ULL << i) & used) == 0) {
            int sg = grundyNumber(k - i, (1ULL << i) | used);
            s.insert(sg);
        }
    }
    if(s.empty()) {
        dp[p] = 0;
        return 0;
    }
    int ret = 0;
    while(s.find(ret) != s.end()) {
        ++ret;
    }
    dp[p] = ret;
    return ret;
}

int main()
{
    srand(__rdtsc());
    seed = rand();

    int n, y = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        y ^= grundyNumber(x, 0);
    }
    if(y == 0) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

map<pair<int, int64_t>, int> mp;

int Solve(int x, int64_t mask) {
    //cerr << x << ' ' << mask << endl;
    mask = mask & ((1LL << x) - 1);
    if (mp.count({x, mask})) {
        return mp[{x, mask}];
    }
    set<int> st;
    for (int i = 0; i <= x; ++i) {
        st.insert(i);
    }
    for (int i = 0; i < x; ++i) {
        int bit = 1LL << i;
        if (mask & bit == bit) {
            st.erase(Solve(x - i - 1, mask - bit));
        }
    }
    return mp[{x, mask}] = *st.begin();
}

int main()
{
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    int ans = 0;
    for (const auto &e : v) {
        ans ^= Solve(e, (1LL << e) - 1);
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    cerr << mp.size();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

map<pair<int, int64_t>, int> mp;

int Solve(int x, int64_t mask) {
    //cerr << x << ' ' << mask << endl;
    mask = mask & ((1LL << x) - 1);
    if (mp.count({x, mask})) {
        return mp[{x, mask}];
    }
    set<int> st;
    for (int i = 0; i <= x; ++i) {
        st.insert(i);
    }
    for (int i = 0; i < x; ++i) {
        int64_t bit = 1LL << i;
        if (mask >> i & 1) {
            st.erase(Solve(x - i - 1, mask - bit));
        }
    }
    return mp[{x, mask}] = *st.begin();
}

void test() {
    int n = 60;
    for (int i = 1; i <= n; ++i) {
        cout << i << ' ' << Solve(i, (1LL << i) - 1) << endl;
    }
    exit(1);
}

int main()
{
    //test();
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    int ans = 0;
    for (const auto &e : v) {
        ans ^= Solve(e, (1LL << e) - 1);
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    cerr << mp.size();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   // freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    if (n == 1) {
        cout << "NO" << endl;
        return 0;
    }
    int even = 0, odd=0;
    for (int i = 0; i < n; ++i) {
        int s;
        cin >> s;
        if (s == 1 || s == 2) {
            ++odd;
            continue;
        }
        int ans = 0;
        while (s % 2 == 0) {
            ans++;
            s /= 2;
        }
        if (ans % 2) ++odd;
        else ++even;
    }
    if ( odd % 2 == 0 && even % 2 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

map<pair<int, int64_t>, int> mp;

int Solve(int x, int64_t mask) {
    //cerr << x << ' ' << mask << endl;
    mask = mask & ((1LL << x) - 1);
    if (mp.count({x, mask})) {
        return mp[{x, mask}];
    }
    set<int> st;
    for (int i = 0; i <= x; ++i) {
        st.insert(i);
    }
    for (int i = 0; i < x; ++i) {
        int64_t bit = 1LL << i;
        if (mask >> i & 1) {
            st.erase(Solve(x - i - 1, mask - bit));
        }
    }
    return mp[{x, mask}] = *st.begin();
}

void test() {
    int n = 60;
    for (int i = 1; i <= n; ++i) {
        cout << i << ' ' << Solve(i, (1LL << i) - 1) << endl;
    }
    exit(1);
}

int main()
{
    test();
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    int ans = 0;
    for (const auto &e : v) {
        ans ^= Solve(e, (1LL << e) - 1);
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    cerr << mp.size();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

map<pair<int, int64_t>, int> mp;

int Solve(int x, int64_t mask) {
    //cerr << x << ' ' << mask << endl;
    if (x == 0) {
        return 0;
    }
    mask = mask & ((1LL << x) - 1);
    if (mp.count({x, mask})) {
        return mp[{x, mask}];
    }
    set<int> st;
    for (int i = 0; i <= x; ++i) {
        st.insert(i);
    }
    for (int i = 0; i < x; ++i) {
        int bit = 1 << i;
        if (mask & bit == bit) {
            st.erase(Solve(x - i - 1, mask - bit));
        }
    }
    return mp[{x, mask}] = *st.begin();
}

int main()
{
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    int ans = 0;
    for (const auto &e : v) {
        ans ^= Solve(e, (1LL << e) - 1);
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    cerr << mp.size();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    set<int> st;
    for (int i = 0; i < 100; ++i) {
        st.insert(i);
    }
    int max_n = *max_element(v.begin(), v.end());
    vector<vector<int> > dp(max_n + 1, vector<int>((1 << max_n)));
    for (int i = 1; i <= max_n; ++i) {
        //cerr << "I = " << i << endl;
        for (int j = 1; j < (1 << i); ++j) {
           // cerr << "J = " << j << endl;
            vector<int> v;
            for (int q = 0; q < i; ++q) {
                int mask = 1 << q;
                if ((mask & j) == mask) {
                    int t = dp[i - q - 1][j - mask];
                    st.erase(t);
                    v.push_back(t);
                }
            }
            dp[i][j] = *st.begin();
         //   cerr << dp[i][j] << endl;
            while (v.size()){
                st.insert(v.back());
                v.pop_back();
            }
        }
    }
    //cerr << "Close DP" << endl;

    int ans = 0;
    for (const auto &e : v) {
        cerr << dp[e][(1 << e) - 1] << endl;
        ans ^= dp[e][(1<<e) - 1];
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   // freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    if (n == 1) {
        cout << "NO" << endl;
        return 0;
    }
    int ans = 0, odd=0;
    for (int i = 0; i < n; ++i) {
        int s;
        cin >> s;
        ans += s == 1;
        while (s % 2 == 0) {
            ans++;
            s /= 2;
        }
    }
    if ( ans % 2 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

map<pair<int, int64_t>, int> mp;

int Solve(int x, int64_t mask) {
    //cerr << x << ' ' << mask << endl;
    mask = mask & ((1LL << x) - 1);
    if (mp.count({x, mask})) {
        return mp[{x, mask}];
    }
    set<int> st;
    for (int i = 0; i <= x; ++i) {
        st.insert(i);
    }
    for (int i = 0; i < x; ++i) {
        int64_t bit = 1LL << i;
        if (mask & bit == bit) {
            st.erase(Solve(x - i - 1, mask - bit));
        }
    }
    return mp[{x, mask}] = *st.begin();
}

int main()
{
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    int ans = 0;
    for (const auto &e : v) {
        ans ^= Solve(e, (1LL << e) - 1);
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    cerr << mp.size();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
  //  freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &e : v) {
        cin >> e;
    }
    set<int> st;
    for (int i = 0; i < 100; ++i) {
        st.insert(i);
    }
    int max_n = *max_element(v.begin(), v.end());
    vector<vector<int> > dp(max_n + 1, vector<int>((1 << max_n)));
    for (int i = 1; i <= max_n; ++i) {
        //cerr << "I = " << i << endl;
        for (int j = 1; j < (1 << i); ++j) {
           // cerr << "J = " << j << endl;
            vector<int> v;
            for (int q = 0; q < i; ++q) {
                int mask = 1 << q;
                if ((mask & j) == mask) {
                    int t = dp[i - q - 1][j - mask];
                    st.erase(t);
                    v.push_back(t);
                }
            }
            dp[i][j] = *st.begin();
         //   cerr << dp[i][j] << endl;
            while (v.size()){
                st.insert(v.back());
                v.pop_back();
            }
        }
    }
    //cerr << "Close DP" << endl;

    int ans = 0;
    for (const auto &e : v) {
        cerr << dp[e][(1 << e) - 1] << endl;
        ans ^= dp[e][(1<<e) - 1];
    }
    cout << (ans == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(vlong i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(vlong i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((vlong)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((vlong)(x).size())
#define NORM(x) if(x>=mod) x-=mod;if(x<0) x+=mod;
#define MOD(x,y) (((x)*(y))%mod)
#define ODD(x) (((x)&1)==0?(0):(1))
#define Set(N,cur) N=(N|(1<<cur))
#define Reset(N,cur) N=(N&(~(1<<cur)))
#define Check(N,cur) (!((N&(1<<cur))==0))
#define dbgA(A,i) debug("At pos: ",i," = ",A[i])
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp debug ("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)
     #define bug printf("%d\n",__LINE__);

#else
     #define debug(args...)  // Just strip off all debug tokens
     #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

#define LL long long
#define LLU long long unsigned int
typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0; x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1; r = r2 % r1;
        x = x2 - (q * x1); y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

inline int STRLEN(char *s){
    int p = 0; while(s[p]) p++; return p;
}

inline LL SQRT(LL a){
    LL v = sqrt(a);
    if(SQ(v) == a) return v;
    else if(SQ(v+1) == a) return v+1;
    else if(SQ(v+2) == a) return v+2;
    else return -1; /// a can no be written as p^2
}

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
//int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};

const int inf = 100000000;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-9;

///=========================  TEMPLATE ENDS HERE  ========================///
///=======================================================================///

#define Size 1000055

int N;
int A[Size];

int main () {

    #ifdef forthright48
    //freopen ( "input.txt", "r", stdin );
    //freopen ( "output A.txt", "w", stdout );
    #endif // forthright48

    scanf("%d",&N);
    for(int i = 0;i<N;i++){
        scanf("%d",&A[i]);
    }

    sort(A,A+N);
    int xrr = A[0];
    for(int i = 1;i<N;i++){
        xrr ^= (A[i]-A[i-1]);
    }

    //printf("xrr: %d\n",xrr);
    if(xrr == 0){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(vlong i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(vlong i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((vlong)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((vlong)(x).size())
#define NORM(x) if(x>=mod) x-=mod;if(x<0) x+=mod;
#define MOD(x,y) (((x)*(y))%mod)
#define ODD(x) (((x)&1)==0?(0):(1))
#define Set(N,cur) N=(N|(1<<cur))
#define Reset(N,cur) N=(N&(~(1<<cur)))
#define Check(N,cur) (!((N&(1<<cur))==0))
#define dbgA(A,i) debug("At pos: ",i," = ",A[i])
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp debug ("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)
     #define bug printf("%d\n",__LINE__);

#else
     #define debug(args...)  // Just strip off all debug tokens
     #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

#define LL long long
#define LLU long long unsigned int
typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0; x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1; r = r2 % r1;
        x = x2 - (q * x1); y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

inline int STRLEN(char *s){
    int p = 0; while(s[p]) p++; return p;
}

inline LL SQRT(LL a){
    LL v = sqrt(a);
    if(SQ(v) == a) return v;
    else if(SQ(v+1) == a) return v+1;
    else if(SQ(v+2) == a) return v+2;
    else return -1; /// a can no be written as p^2
}

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
//int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};

const int inf = 100000000;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-9;

///=========================  TEMPLATE ENDS HERE  ========================///
///=======================================================================///

#define Size 1000055

int N;
int A[Size];

int main () {

    #ifdef forthright48
    //freopen ( "input.txt", "r", stdin );
    //freopen ( "output A.txt", "w", stdout );
    #endif // forthright48

    scanf("%d",&N);
    int xrr = 0;
    for(int i = 0;i<N;i++){
        scanf("%d",&A[i]);
    }

    sort(A,A+N);
    for(int i = 1;i<N;i++){
        A[i] -= A[i-1];
    }

    for(int i = 0;i<N;i++){
        xrr ^= A[i];
    }

    //printf("xrr: %d\n",xrr);
    if(xrr == 0){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(vlong i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(vlong i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((vlong)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((vlong)(x).size())
#define NORM(x) if(x>=mod) x-=mod;if(x<0) x+=mod;
#define MOD(x,y) (((x)*(y))%mod)
#define ODD(x) (((x)&1)==0?(0):(1))
#define Set(N,cur) N=(N|(1LL<<cur))
#define Reset(N,cur) N=(N&(~(1LL<<cur)))
#define Check(N,cur) (!((N&(1LL<<cur))==0))
#define dbgA(A,i) debug("At pos: ",i," = ",A[i])
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp debug ("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)
     #define bug printf("%d\n",__LINE__);

#else
     #define debug(args...)  // Just strip off all debug tokens
     #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

#define LL long long
#define LLU long long unsigned int
typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0; x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1; r = r2 % r1;
        x = x2 - (q * x1); y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

inline int STRLEN(char *s){
    int p = 0; while(s[p]) p++; return p;
}

inline LL SQRT(LL a){
    LL v = sqrt(a);
    if(SQ(v) == a) return v;
    else if(SQ(v+1) == a) return v+1;
    else if(SQ(v+2) == a) return v+2;
    else return -1; /// a can no be written as p^2
}

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
//int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};

const int inf = 100000000;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-7;

///=========================  TEMPLATE ENDS HERE  ========================///
///=======================================================================///

#define Size 1000055

int N;
map<pll,LL> DP;

LL call(LL cur, LL mask){
    pll state = MP(cur,mask);
    if(DP.find(state) != DP.end()) return DP[state];

    vector<LL> List;

    for(int k = 1;k<=cur;k++){
        if(Check(mask,k) == true) continue;
        LL nMask = Set(mask,k);
        int g = call(cur - k, nMask);
        List.pb(g);
    }

    sort(ALL(List));
    UNIQUE(List);

    for(int i = 0;i<List.size();i++){
        if(List[i] != i){
            return DP[state] = i;
        }
    }
    return DP[state] = List.size();
    return 0;
}

int main () {

    #ifdef forthright48
    //freopen ( "input.txt", "r", stdin );
    //freopen ( "output A.txt", "w", stdout );
    #endif // forthright48

    int N;
    scanf("%d",&N);
    int xrr = 0;
    for(int i = 0;i<N;i++){
        int num;
        scanf("%d",&num);
        xrr ^= call(num,0);
    }
    if(xrr == 0) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(vlong i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(vlong i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((vlong)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((vlong)(x).size())
#define NORM(x) if(x>=mod) x-=mod;if(x<0) x+=mod;
#define MOD(x,y) (((x)*(y))%mod)
#define ODD(x) (((x)&1)==0?(0):(1))
#define Set(N,cur) N=(N|(1<<cur))
#define Reset(N,cur) N=(N&(~(1<<cur)))
#define Check(N,cur) (!((N&(1<<cur))==0))
#define dbgA(A,i) debug("At pos: ",i," = ",A[i])
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp debug ("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)
     #define bug printf("%d\n",__LINE__);

#else
     #define debug(args...)  // Just strip off all debug tokens
     #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

#define LL long long
#define LLU long long unsigned int
typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0; x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1; r = r2 % r1;
        x = x2 - (q * x1); y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

inline int STRLEN(char *s){
    int p = 0; while(s[p]) p++; return p;
}

inline LL SQRT(LL a){
    LL v = sqrt(a);
    if(SQ(v) == a) return v;
    else if(SQ(v+1) == a) return v+1;
    else if(SQ(v+2) == a) return v+2;
    else return -1; /// a can no be written as p^2
}

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
//int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};

const int inf = 100000000;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-9;

///=========================  TEMPLATE ENDS HERE  ========================///
///=======================================================================///

#define Size 1000055

int N;
int A[Size];

int main () {

    #ifdef forthright48
    //freopen ( "input.txt", "r", stdin );
    //freopen ( "output A.txt", "w", stdout );
    #endif // forthright48

    scanf("%d",&N);
    for(int i = 0;i<N;i++){
        scanf("%d",&A[i]);
        if(A[i]>1) A[i]--;
    }

    sort(A,A+N);
    int xrr = A[0];
    for(int i = 1;i<N;i++){
        xrr ^= (A[i]);
    }

    //printf("xrr: %d\n",xrr);
    if(xrr == 0){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;

int a[100],aa[100],n,ans;

int main()
{
	for(int i=1;i<=60;i++)
	{
		int sum=0;
		for(int j=1;j<=12;j++)
		{
			sum+=j;
			if(sum>i)
				aa[i]=j-1;
		}
	}
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x]=!a[x];
	}
	for(int i=1;i<=60;i++)
	{
		if(a[i])
			ans^=aa[i];
	}
	if(!ans)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;

int a[100],aa[100],n,ans;

int main()
{
	for(int i=1;i<=60;i++)
	{
		int sum=0;
		for(int j=1;j<=12;j++)
		{
			sum+=j;
			if(sum>i)
			{aa[i]＝j-1;
break;}
		}
	}
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x]=!a[x];
	}
	for(int i=1;i<=60;i++)
	{
		if(a[i])
			ans^=aa[i];
	}
	if(!ans)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;

int a[100],aa[100],n,ans;

int main()
{
	for(int i=1;i<=60;i++)
	{
		int sum=0;
		for(int j=1;j<=12;j++)
		{
			sum+=j;
					if(sum>i)
					{aa[i]=j-1;break;
		}
		}
	}
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x]=!a[x];
	}
	for(int i=1;i<=60;i++)
	{
		if(a[i])
			ans^=aa[i];
	}
	if(!ans)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;

int a[100],aa[100],n,ans;

int main()
{
	for(int i=1;i<=60;i++)
	{
		int sum=0;
		for(int j=1;j<=11;j++)
		{
			sum+=j;
			if(sum>i)
				aa[i]=j-1;
		}
	}
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x]=!a[x];
	}
	for(int i=1;i<=60;i++)
	{
		if(a[i])
			ans^=aa[i];
	}
	if(!ans)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<set>
#include<unordered_map>
using namespace std;
int main(){
	unordered_map<int,unordered_map<long long,int>> grundy;
	for(int i=1;i<=60;i++){
		for(long long max=1;max<(1<<i);max++){
			bool mex[61]={0};
			for(int j=1;j<=i;j++){
				if(max&(1<<j)){
					mex[grundy[i-j][max^(1<<j)]]=1;}}
			for(int j=0;j<=i;j++){
				if(mex[j]==0){grundy[i][max]=j;break;}}}}
int n;
cin>>n;
int x=0;
for(int i=0;i<n;i++){
	int y;
	cin>>y;
	x^=grundy[y][1<<y-1];}
if(x==0){
	cout<<"NO\n";}
else{cout<<"YES\n";}
	return 0;}


#include<iostream>
#include<set>
#include<unordered_map>
using namespace std;
int main(){
	unordered_map<long long,int> grundy[61];
	for(int i=1;i<=60;i++){
		for(long long max=1;max<(1<<i);max++){
			bool mex[61]={0};
			for(int j=1;j<=i;j++){
				if(max&(1<<j)){
					mex[grundy[i-j][max^(1<<j)]]=1;}}
			for(int j=0;j<=i;j++){
				if(mex[j]==0){grundy[i][max]=j;break;}}}}
int n;
cin>>n;
int x=0;
for(int i=0;i<n;i++){
	int y;
	cin>>y;
	x^=grundy[y][1<<y-1];}
if(x==0){
	cout<<"NO\n";}
else{cout<<"YES\n";}
	return 0;}


#include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 2e6 + 9;
string first = "NO";
string second = "YES";
int main(){
    ios_base::sync_with_stdio (0),cin.tie(0);
    int n;
    cin >> n;
    if(n == 1) {
        cout << first << endl;
        return 0;
    }
    int cnt = 0;
    int cnt2 = 0;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        if(x == 2 or x == 1) cnt++;
        else cnt2++;
    }
    if(cnt == 0){
        cnt2 &= 1;
        if(!cnt2) cout << second << endl;
        else cout << first << endl;
    return 0;
    }
    cnt &= 1;
    cnt2 &= 1;
    if(cnt ^ cnt2) cout << first << endl;
    else cout << second << endl;
}


#include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 2e6 + 9;
string first = "NO";
string second = "YES";
int main(){
    ios_base::sync_with_stdio (0),cin.tie(0);
    int n;
    cin >> n;
    if(n == 1) {
        cout << first << endl;
        return 0;
    }
    int cnt = 0;
    int cnt2 = 0;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        if(x == 2 or x == 1) cnt++;
        else cnt2++;
    }
    cnt &= 1;
    cnt2 &= 1;
    if(cnt ^ cnt2) cout << first << endl;
    else cout << second << endl;
}


#include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 2e6 + 9;
string first = "NO";
string second = "YES";
int main(){
    ios_base::sync_with_stdio (0),cin.tie(0);
    int n;
    cin >> n;
    int cnt = 0;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        if(x == 2 or x == 1) cnt++;
    }
    if(cnt & 1 or n == 1) cout << first << endl;
    else cout << second << endl;
}


#include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 2e6 + 9;
string first = "NO";
string second = "YES";
int get(int x, LL msk){
    if(x == 0) return 0;
    set<int> st;
    for(int i = 1; i <= 60; i++){
        int bit = !!(msk & (1LL << i));
        if(i <= x && !bit) st.insert(get(x - i, msk | (1LL << i)));
    }
    int ret = 0;
    while(true){
        if(!st.count(ret)) return ret;
        ret++;
    }
}
int grundy(int x){
    int ret = 1;
    while(ret * (ret + 1) / 2 <= x) ret++;
    return ret - 1;
}
int main(){
    ios_base::sync_with_stdio (0),cin.tie(0);
    int n;
    cin >> n;
    int cnt = 0;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        cnt  ^= grundy(x);
    }
    if(cnt) cout << first << endl;
    else cout << second << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define forall(it, v) for(auto it = v.begin(); it != v.end(); ++it)
#define dforn(i, n) for(int i = ((int) n) - 1; i >= 0; i--)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define ff first
#define ss second
typedef long long ll;
const int MAXN = -1;

int n, dp[65][600000], t;
ll DOS[65];
map<ll, int> M;

int rundp(int sz, ll bm){
    if(!M.count(bm))M[bm] = t++;
    int m = M[bm];

    int &ret = dp[sz][m];
    if(ret != -1)return ret;

    int BM = bm;
    vector<bool> B; forn(i, 62){B.pb(BM%2); BM/=2;}
    vector<int> V;
    forr(i, 1, 62){
        if(B[i])continue;
        if(sz < i)break;
        V.pb(rundp(sz-i, bm+DOS[i]));
    }
    sort(V.begin(), V.end());
    V.erase(unique(V.begin(), V.end()), V.end());
    int c = 0; while(c < V.size() && V[c] == c)c++;
//    printf("La solucion para sz = %d, bm = %d.\nEs %d\n", sz, bm, c);
    return ret = c;
}

int main(){
//	freopen("input.txt", "r", stdin);
	DOS[0] = 1; forr(i, 1, 65)DOS[i] = DOS[i-1]*2;
	while(scanf("%d", &n) == 1){
        forn(i, 62)forn(j, 1030500)dp[i][j] = -1;
        int ans = 0;
        forn(i, n){
            int x; scanf("%d", &x);
            ans ^= rundp(x, 0);
        }
        cout << (ans ? "NO" : "YES") << endl;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define forall(it, v) for(auto it = v.begin(); it != v.end(); ++it)
#define dforn(i, n) for(int i = ((int) n) - 1; i >= 0; i--)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define ff first
#define ss second
typedef long long ll;
const int MAXN = -1;

int n, dp[65][600000], t;
ll DOS[65];
map<ll, int> M;

int rundp(int sz, ll bm){
    if(!M.count(bm))M[bm] = t++;
    int m = M[bm];

    int &ret = dp[sz][m];
    if(ret != -1)return ret;

//    int BM = bm;
//    vector<bool> B; forn(i, 62){B.pb(BM%2); BM/=2;}
    vector<int> V;
    forr(i, 1, 62){
        if(bm & (1 << i))continue;
        if(sz < i)break;
        V.pb(rundp(sz-i, bm+DOS[i]));
    }
    sort(V.begin(), V.end());
    V.erase(unique(V.begin(), V.end()), V.end());
    int c = 0; while(c < V.size() && V[c] == c)c++;
//    printf("La solucion para sz = %d, bm = %d.\nEs %d\n", sz, bm, c);
    return ret = c;
}

int main(){
//	freopen("input.txt", "r", stdin);
	DOS[0] = 1; forr(i, 1, 65)DOS[i] = DOS[i-1]*2;
	while(scanf("%d", &n) == 1){
        forn(i, 62)forn(j, 1030500)dp[i][j] = -1;
        int ans = 0;
        forn(i, n){
            int x; scanf("%d", &x);
            ans ^= rundp(x, 0);
        }
        cout << (ans ? "NO" : "YES") << endl;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define forall(it, v) for(auto it = v.begin(); it != v.end(); ++it)
#define dforn(i, n) for(int i = ((int) n) - 1; i >= 0; i--)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define ff first
#define ss second
typedef long long ll;
const int MAXN = -1;

int n, dp[65][1030500];
ll DOS[65];

int rundp(int sz, int bm){

    int &ret = dp[sz][bm];
    if(ret != -1)return ret;

    int BM = bm;
    vector<bool> B; forn(i, 62){B.pb(BM%2); BM/=2;}
    vector<int> V;
    forr(i, 1, 62){
        if(B[i])continue;
        if(sz < i)break;
        V.pb(rundp(sz-i, bm+DOS[i]));
    }
    sort(V.begin(), V.end());
    V.erase(unique(V.begin(), V.end()), V.end());
    int c = 0; while(c < V.size() && V[c] == c)c++;
//    printf("La solucion para sz = %d, bm = %d.\nEs %d\n", sz, bm, c);
    return ret = c;
}

int main(){
//	freopen("input.txt", "r", stdin);
	DOS[0] = 1; forr(i, 1, 65)DOS[i] = DOS[i-1]*2;
	while(scanf("%d", &n) == 1){
        forn(i, 62)forn(j, 1030500)dp[i][j] = -1;
        int ans = 0;
        forn(i, n){
            int x; scanf("%d", &x);
            ans ^= rundp(x, 0);
        }
        cout << (ans ? "NO" : "YES") << endl;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e2+5, inf = 1e9+7;
int n, k, i, j;
int A[N];

int solve(int a, int mask){
    if(a==0) return 0;
    bitset<62>b(0);
    for(int i=1; i<=a; i++) if(!(mask>>i&1))
        b[solve(a-i, mask|(1<<i))]=1;
    for(int i=0; i<=61; i++) if(b[i]==0)
        return i;
}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n;
    rep(i, 1, 61) solve(i, 0);
    rep(i, 1, n+1) cin>>A[i], ans^=dp[A[i]][0];
    if(ans) cout<<"NO";
    else cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e2+5, inf = 1e9+7;
int n, k, i, j;
int grundy[N];

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i=1, j, a, b, ans = 0;
    cin>>n;
    int cur = 1, pending = 2;
    while(i<=60){
        grundy[i] = cur;
        pending--;
        if(!pending){
            cur++;
            pending = cur+1;
        }
        i++;
    }
    rep(i, 1, n+1) cin>>a, ans^=grundy[a];
    if(ans) cout<<"NO";
    else cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e2+5, inf = 1e9+7;
int n, k, i, j;
int A[N];
unordered_map<int, int>dp[61], done[61];

int solve(int a, int mask){
    if(a==0) return 0;
    if(done[a][mask]) return dp[a][mask];
    done[a][mask] = 1;
    dp[a][mask] = 0;
    bitset<61>b(0);
    for(int i=1; i<=a; i++) if(!(mask>>i&1))
        b[solve(a-i, mask|(1<<i))]=1;
    for(int i=0; i<=60; i++) if(b[i]==0)
        return dp[a][mask] = i;
}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n;
    rep(i, 1, 61) solve(i, 0);
    rep(i, 1, n+1) cin>>a, ans^=dp[a][0];
    if(ans) cout<<"NO";
    else cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e2+5, inf = 1e9+7;
int n, k, i, j;
int f[N];

int solve(int a, int mask){
    if(a==0) return 0;
    bitset<62>b(0);
    for(int i=1; i<=a; i++) if(!(mask>>i&1))
        b[solve(a-i, mask|(1<<i))]=1;
    for(int i=0; i<=61; i++) if(b[i]==0)
        return i;
}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n;
    rep(i, 1, 61) f[i] = solve(i, 0);
    rep(i, 1, n+1) cin>>a, ans^=f[a];
    if(ans) cout<<"NO";
    else cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e2+5, inf = 1e9+7;
int n, k, i, j;
int A[N];
unordered_map<int, int>dp[61], done[61];

int solve(int a, int mask){
    if(a==0) return 0;
    if(done[a][mask]) return dp[a][mask];
    done[a][mask] = 1;
    dp[a][mask] = 0;
    bitset<61>b(0);
    for(int i=1; i<=a; i++) if(!(mask>>i&1))
        b[solve(a-i, mask|(1<<i))]=1;
    for(int i=0; i<=60; i++) if(b[i]==0)
        return dp[a][mask] = i;
}

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n;
    rep(i, 1, 61) solve(i, 0);
    rep(i, 1, n+1) cin>>A[i], ans^=dp[A[i]][0];
    if(ans) cout<<"NO";
    else cout<<"YES";
}


/*
author: madhav_1999 aka orthodoxparadox
28-Jul-2019
03:47:48
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) sz(x)
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ")
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);}
#else
#define dbg(...)
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}

const int N = 63;
map<pii, bool> vis;
map<pii, int> grundy;
int g[N];

int dp(int stones, int mask)
{
	if(stones == 0) return 0;
	if(vis[mp(stones, mask)]) return grundy[mp(stones, mask)];
	set<int> mex;
	for(int i = 0; i < N; i++)
	{
		if(mask & (1LL << i))
		{
			if(stones >= i + 1)
			{
				mex.insert(dp(stones - i - 1, mask ^ (1LL << i)));
				dbg(stones - i, mask ^ (1LL << i));
				dbg(mex);
			}
		}
	}
	dbg(stones, mask, mex);
	for(int i = 0; i <= N; i++)
	{
		if(mex.find(i) == mex.end())
		{
			vis[mp(stones, mask)] = true;
			return grundy[mp(stones, mask)] = i;
		}
	}
	assert(false);
	return 0;
}

void init()
{
	for(int i = 1; i < N; i++)
	{
		g[i] = dp(i, (1LL << i) - 1);
		dbg(i, g[i]);
	}
}

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		ans ^= g[x];
	}
	cout << (ans ? "NO" : "YES");
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int t = 1;
	// cin >> t;
	init();
	while(t--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}


/*
author: madhav_1999 aka orthodoxparadox
28-Jul-2019
03:47:48
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) sz(x)
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ")
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);}
#else
#define dbg(...)
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}

const int N = 63;
map<pii, bool> vis;
map<pii, int> grundy;
int g[N];

int dp(int stones, int mask)
{
	if(stones == 0) return 0;
	if(vis[mp(stones, mask)]) return grundy[mp(stones, mask)];
	for(int i = stones; i < N; i++) if(mask & ~(1LL << i));
	set<int> mex;
	for(int i = 0; i < N; i++)
	{
		if(mask & (1LL << i))
		{
			if(stones >= i + 1)
			{
				mex.insert(dp(stones - i - 1, mask ^ (1LL << i)));
				dbg(stones - i, mask ^ (1LL << i));
				dbg(mex);
			}
		}
	}
	dbg(stones, mask, mex);
	for(int i = 0; i <= N; i++)
	{
		if(mex.find(i) == mex.end())
		{
			vis[mp(stones, mask)] = true;
			return grundy[mp(stones, mask)] = i;
		}
	}
	assert(false);
	return 0;
}

void init()
{
	for(int i = 1; i < N; i++)
	{
		g[i] = dp(i, (1LL << i) - 1);
		dbg(i, g[i]);
	}
}

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		ans ^= g[x];
	}
	cout << (ans ? "NO" : "YES");
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int t = 1;
	// cin >> t;
	init();
	while(t--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}


/*
author: madhav_1999 aka orthodoxparadox
28-Jul-2019
03:47:48
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) sz(x)
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ")
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);}
#else
#define dbg(...)
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}

const int N = 6;
map<pii, bool> vis;
map<pii, int> grundy;
int g[N];

int dp(int stones, int mask)
{
	if(stones == 0) return 0;
	if(vis[mp(stones, mask)]) return grundy[mp(stones, mask)];
	set<int> mex;
	for(int i = 0; i < N; i++)
	{
		if(mask & (1LL << i))
		{
			if(stones >= i + 1)
			{
				mex.insert(dp(stones - i - 1, mask ^ (1LL << i)));
				dbg(stones - i, mask ^ (1LL << i));
				dbg(mex);
			}
		}
	}
	dbg(stones, mask, mex);
	for(int i = 0; i <= N; i++)
	{
		if(mex.find(i) == mex.end())
		{
			vis[mp(stones, mask)] = true;
			return grundy[mp(stones, mask)] = i;
		}
	}
	assert(false);
	return 0;
}

void init()
{
	for(int i = 1; i < N; i++)
	{
		g[i] = dp(i, (1LL << i) - 1);
		dbg(i, g[i]);
	}
}

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		ans ^= g[x];
	}
	cout << (ans ? "NO" : "YES");
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int t = 1;
	// cin >> t;
	init();
	while(t--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1e3 + 5;
const int INF = 1e9 + 7;

map<pair<int, ll>, bool> calculated;
map<pair<int, ll>, int> grundy;

int cntGrundy(int number, ll mask, int prev = 63) {
	for (ll i = number; i < prev; i++) {
		if (mask & (1ll << i)) {
			mask -= (1ll << i);
		}
	}
	if (calculated[MP(number, mask)]) {
		return grundy[MP(number, mask)];
	}
	vector<bool> found;
	found.resize(65, false);
	for (int k = 0; k < number; k++) {
		if (mask & (1ll << k)) {
			found[cntGrundy(number - k - 1, (mask - (1ll << k)), number)] = true;
		}
	}
	int res;
	for (int i = 0; i < 63; i++) {
		if (!found[i]) {
			grundy[MP(number, mask)] = i;
			calculated[MP(number, mask)] = true;
			res = i;
			break;
		}
	}

	return res;
}

void solve() {

	calculated[MP(0, 0)] = true;
	grundy[MP(0, 0)] = 0;

	vi grundyValues(65, 0);

	for (ll i = 0; i <= 60; i++)
		grundyValues[i] = cntGrundy((int)i, (1ll << i) - 1ll);

	int n, x, ans = 0;
	cin >> n;
	while (n--) {
		cin >> x;
		ans ^= grundyValues[x];
	}

	if (ans == 0) {
		cout << "YES\n";
	} else {
		cout << "NO\n";
	}

}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	solve();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

map<pair<int, ll>, int> grundy;
map<pair<int, ll>, bool> mp;

int retgrundy(int ps, ll bm, int prev = 63){
    for(int i=ps ; i<prev ; ++i){
        if(((bm>>i)&1LL) == 1LL)
            bm ^= (1LL<<i);
    }
    if(mp[{ps, bm}])
        return grundy[{ps, bm}];
    vector<bool> marked(63, false);
    for(int k=0 ; k<ps ; ++k){
        if(((bm>>k)&1LL) == 0)
            continue;
        marked[retgrundy(ps-k-1LL, (bm^(1LL<<k)), ps)] = true;
    }
    int ret;
    for(int i=0 ; i<63 ; ++i){
        if(marked[i])
            continue;
        grundy[{ps, bm}] = i;
        ret = i;
        break;
    }
    mp[{ps, bm}] = true;
    return ret;
}

int main(){
    int n, in, x=0;
    scanf("%d", &n);

    grundy[{0, 0}] = 0;
    mp[{0, 0}] = true;
    vector<int> gr(70, 0);

    for(int i=0 ; i<=60 ; ++i)
        gr[i] = retgrundy(i, (1LL<<i)-1LL);

    while(n--){
        scanf("%d", &in);
        x ^= gr[in];
    }

    if(x == 0)
        printf("YES");
    else
        printf("NO");

}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1e3 + 5;
const int INF = 1e9 + 7;

map<pair<int, ll>, bool> calculated;
map<pair<int, ll>, int> grundy;

int cntGrundy(int number, ll mask, int prev = 63) {
	for (ll i = number; i < prev; i++) {
		if (mask & (1ll << i)) {
			mask -= (1ll << i);
		}
	}
	if (calculated[MP(number, mask)]) {
		return grundy[MP(number, mask)];
	}
	vector<bool> found;
	found.resize(65, false);
	for (int k = 0; k < number; k++) {
		if (mask & (1ll << k)) {
			found[cntGrundy(number - k - 1, (mask - (1ll << k)), number)] = true;
		}
	}
	int res;
	for (int i = 0; i < 63; i++) {
		if (!found[i]) {
			grundy[MP(number, mask)] = i;
			calculated[MP(number, mask)] = true;
			res = i;
			break;
		}
	}

	return res;
}

void solve() {

	calculated[MP(0, 0)] = true;
	grundy[MP(0, 0)] = 0;

	vi grundyValues(65, 0);

	for (ll i = 0; i <= 60; i++)
		grundyValues[i] = cntGrundy((int)i, (1 << i) - 1);

	int n, x, ans = 0;
	cin >> n;
	while (n--) {
		cin >> x;
		ans ^= grundyValues[x];
	}

	if (ans == 0) {
		cout << "YES\n";
	} else {
		cout << "NO\n";
	}

}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	solve();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn = 60 + 5;
map<pair<int, long long>, int> dp;

int go(int now, long long s) {
    if (now == 0) return 0;
    if (dp.find(make_pair(now, s)) != dp.end()) return dp[make_pair(now, s)];
    vector<int> sg;
    for (int i = 0; i < now; ++i) if ((1ll << i) & s) {
        sg.push_back(go(now - i - 1, s ^ (1ll << i)));
    }
    sort(sg.begin(), sg.end());
    size_t ptr = 0;
    for (int i = 0; ; ++i) {
        bool f = false;
        while (ptr < sg.size() && sg[ptr] == i) ++ptr, f = true;
        if (!f) return dp[make_pair(now, s)] = i;
    }
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int sg = 0;
    int n; cin >> n; while (n--) {
        int s; cin >> s;
        sg ^= go(s, (1ll << s) - 1);
    }
    cout << (sg ? "NO" : "YES") << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn = 60 + 5;
int dp[maxn][maxn];

int go(int now, int ptr) {
    if (now == 0) return 0;
    if (ptr > now) return 0;
    if (dp[now][ptr] != -1) return dp[now][ptr];
    dp[now][ptr] = 0;
    if (go(now - ptr, ptr + 1) == 0) dp[now][ptr] = 1;
    if (go(now, ptr + 1) == 0) dp[now][ptr] = 1;
    return dp[now][ptr];
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    memset(dp, -1, sizeof(dp));
    int sg = 0;
    int n; cin >> n; while (n--) {
        int s; cin >> s;
        sg ^= go(s, 1);
    }
    cout << (sg ? "NO" : "YES") << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn = 60 + 5;
map<pair<int, long long>, int> dp;

int go(int now, long long s) {
    if (now == 0) return 0;
    if (dp.find(make_pair(now, s)) != dp.end()) return dp[make_pair(now, s)];
    vector<int> sg;
    for (int i = 0; i < now; ++i) if ((1 << i) & s) {
        sg.push_back(go(now - i - 1, s ^ (1 << i)));
    }
    sort(sg.begin(), sg.end());
    size_t ptr = 0;
    for (int i = 0; ; ++i) {
        bool f = false;
        while (ptr < sg.size() && sg[ptr] == i) ++ptr, f = true;
        if (!f) return dp[make_pair(now, s)] = i;
    }
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int sg = 0;
    int n; cin >> n; while (n--) {
        int s; cin >> s;
        sg ^= go(s, (1 << s) - 1);
    }
    cout << (sg ? "NO" : "YES") << endl;
    return 0;
}


#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;
const int N = 1000005;

int val[61], v;

void init(){
	int pos = 0;
	while(pos < 61){
		for(int i = 0; i <= v and pos < 61; i++){
			val[pos++] = v;
		}
		v++;
	}
	int n, x = 0;
	scanf("%d",&n);
	while(n--){
		scanf("%d",&v);
		x ^= v;
	}
	if(!x) puts("YES");
	else puts("NO");
}

int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	init();
	return 0;
}


#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;
const int N = 1000005;

int val[61], v;

void init(){
	int pos = 0;
	while(pos < 61){
		for(int i = 0; i <= v and pos < 61; i++){
			val[pos++] = v;
		}
		v++;
	}
	int n, x = 0;
	scanf("%d",&n);
	while(n--){
		scanf("%d",&v);
		x ^= val[v];
	}
	if(!x) puts("YES");
	else puts("NO");
}

int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	init();
	return 0;
}


#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, v;
	scanf("%d",&n);
	if(n & 1){
		puts("NO");
		return;
	}
	while(n--){
		scanf("%d",&v);
		if(v > 2){
			puts("NO");
			return;
		}
	}
	puts("YES");
	return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

#define INF 1000000000
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define FORC(cont, it) for(decltype((cont).begin()) it = (cont).begin(); it != (cont).end(); it++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

int main() {
  int grundy[100];

  grundy[0] = 0;

  FOR(i, 1, 61) {
    int cont = 0;
    int acum = 0;
    for(int j = 1; acum < i; j++) {
      cont++;
      acum += j;
    }
    if(acum > i) {
      grundy[i] = cont - 1;
    }
    else
    {
      grundy[i] = cont;
    }
  }
  ll n, s, x = 0;
  cin >>n;
  FOR(i,0, n) {
    cin >> s;
    x = x^grundy[s];
  }

  if(!x) cout << "YES" <<endl;
  if(x) cout << "NO" <<endl;
	return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

#define INF 1000000000
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define FORC(cont, it) for(decltype((cont).begin()) it = (cont).begin(); it != (cont).end(); it++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

int main() {
  int grundy[100];

  grundy[0] = 0;

  FOR(i, 1, 60) {
    int cont = 0;
    int acum = 0;
    for(int j = 1; acum < i; j++) {
      cont++;
      acum += j;
    }
    if(acum >= i) {
      grundy[i] = cont - 1;
    }
    else
    {
      grundy[i] = cont;
    }
  }
  ll n, s, x = 0;
  cin >>n;
  FOR(i,0, n) {
    cin >> s;
    x = x^grundy[s];
  }

  if(!x) cout << "YES" <<endl;
  if(x) cout << "NO" <<endl;
	return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

#define INF 1000000000
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define FORC(cont, it) for(decltype((cont).begin()) it = (cont).begin(); it != (cont).end(); it++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

int main() {
  int grundy[100];

  grundy[0] = 0;

  FOR(i, 1, 60) {
    int cont = 0;
    int acum = 0;
    for(int j = 1; acum < i; j++) {
      cont++;
      acum += j;
    }
    if(acum > i) {
      grundy[i] = cont - 1;
    }
    else
    {
      grundy[i] = cont;
    }
  }
  ll n, s, x = 0;
  cin >>n;
  FOR(i,0, n) {
    cin >> s;
    x = x^grundy[s];
  }

  if(!x) cout << "YES" <<endl;
  if(x) cout << "NO" <<endl;
	return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define x first
#define y second
#define pb push_back
#define ll long long
#define ld long double
#define ii pair<int, int>
#define iii pair<int, ii>
#define vi vector<int>
#define vii vector<ii>
#define pq priority_queue
using namespace std;
const int ms = 2e5+100;
const int mod = 1e9+7;
const int inf = 1e9;
const int sigma = 30;
int n, m, k, t = 1;
string s;

void solve(){
  cin>>n;
  int ans = 0, a, aux;
  for(int i = 0; i<n; i++){
    cin>>a;
    aux = 1;
    while(a>=aux){
      a-=aux;
      ans^=aux;
      aux++;
    }
  }
  if(ans==0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while(t--){
    solve();
  }
}


#include <bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define x first
#define y second
#define pb push_back
#define ll long long
#define int ll
#define ld long double
#define ii pair<int, int>
#define iii pair<int, ii>
#define vi vector<int>
#define vii vector<ii>
#define pq priority_queue
using namespace std;
const int ms = 2e5+100;
const int mod = 1e9+7;
const int inf = 1e9;
const int sigma = 30;
int n, m, k, t = 1;
string s;

void solve(){
  cin>>n;
  int ans = 0, a, aux, sum;
  for(int i = 0; i<n; i++){
    cin>>a;
    aux = 0, sum = 0;
    while(sum<=a){
      sum+=aux;
      aux++;
    }
    ans^=(aux-2);
  }
  if(ans==0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while(t--){
    solve();
  }
}


#include <bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define x first
#define y second
#define pb push_back
#define ll long long
#define ld long double
#define ii pair<int, int>
#define iii pair<int, ii>
#define vi vector<int>
#define vii vector<ii>
#define pq priority_queue
using namespace std;
const int ms = 2e5+100;
const int mod = 1e9+7;
const int inf = 1e9;
const int sigma = 30;
int n, m, k, t = 1;
string s;

void solve(){
  cin>>n;
  int ans = 0, a, aux;
  for(int i = 0; i<n; i++){
    cin>>a;
    aux = 1;
    while(a>=aux){
      a-=aux;
      aux++;
    }
    ans^=aux;
  }
  if(ans==0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while(t--){
    solve();
  }
}


#include <bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define x first
#define y second
#define pb push_back
#define ll long long
#define int ll
#define ld long double
#define ii pair<int, int>
#define iii pair<int, ii>
#define vi vector<int>
#define vii vector<ii>
#define pq priority_queue
using namespace std;
const int ms = 2e5+100;
const int mod = 1e9+7;
const int inf = 1e9;
const int sigma = 30;
int n, m, k, t = 1;
string s;

void solve(){
  cin>>n;
  int ans = 0, a, aux, sum;
  for(int i = 0; i<n; i++){
    cin>>a;
    aux = 1, sum = 0;
    while(sum<=a){
      sum+=aux;
      aux++;
    }
    ans^=(aux-1);
  }
  if(ans==0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while(t--){
    solve();
  }
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

int N;
int S[1010101];
//-----------------------------------------------------------------
map<pair<int, set<int>>, int> memo;
int nim(int x, set<int> s) {
	if (memo.find({ x,s }) != memo.end()) return memo[{x, s}];

	set<int> gra;
	rep(i, 1, x + 1) if (s.find(i) == s.end()) {
		int xx = x - i;
		set<int> ss;
		for (int j : s) if(xx <= j) ss.insert(j);
		if (xx <= i) ss.insert(i);
		gra.insert(nim(xx, ss));
	}

	int mi = 0;
	for (int i : gra) {
		if (mi == i) mi++;
		else break;
	}
	return memo[{x, s}] = mi;
}
//-----------------------------------------------------------------
int main() {
	cin >> N;
	rep(i, 0, N) scanf("%d", &S[i]);

	int ans = 0;
	rep(i, 0, N) {
		int n = nim(S[i], {});
		ans ^= n;
	}
	if (ans == 0)
		printf("YES\n");
	else
		printf("NO\n");
}


#include <bits/stdc++.h>
#define ll long long int
#define pa pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll ans[200];
int main()
{
    BOOST;
    for (ll i=0;i<200;i++)
    {
        ans[i]=i*(i+1)/2;
    }

   ll n;
    cin>>n;

    int val=0;
    for (int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        for (int j=1;j<60;j++)
        {
            x-=j;
            if (x<0)
            {
                val^=j-1;
                break;
            }
        }
    }

    if (val>0)
    {
        cout<<"NO";
    }
    else cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define pa pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;

int main()
{
    BOOST;
    int wynik=0;
    int n;
    cin>>n;
    for (int i=0;i<n;i++)
    {
        int a;
        cin>>a;
        wynik^=(a+1);
    }

    if (wynik&1)cout<<"YES";
    else cout<<"NO";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define pa pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll ans[200];
int main()
{
    BOOST;
    for (ll i=0;i<200;i++)
    {
        ans[i]=i*(i+1)/2;
    }

   ll n;
    cin>>n;

    int val=0;
    for (int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        int a=0;
        for (int j=0;j<200;j++)
        {
            if (ans[j]<=x)
            {
                a=ans[j];
            }
        }
        else break;
        val^=a;
    }

    if (val>0)
    {
        cout<<"NO";
    }
    else cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define pa pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
int ans[200];
int main()
{
    BOOST;
    for (int i=0;i<200;i++)
    {
        ans[i]=i*(i+1)/2;
    }

    int n;
    cin>>n;

    int val=0;
    for (int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        int a=0;
        for (int j=0;j<200;j++)
        {
            if (ans[j]<=x)
            {
                a=ans[j];
            }
        }
        val^=a;
    }

    if (val>0)
    {
        cout<<"NO";
    }
    else cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define pa pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll ans[200];
int main()
{
    BOOST;
    for (ll i=0;i<200;i++)
    {
        ans[i]=i*(i+1)/2;
    }

   ll n;
    cin>>n;

    int val=0;
    for (int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        int a=0;
        for (int j=0;j<200;j++)
        {
            if (ans[j]<=x)
            {
                a=ans[j];
            }
             else break;
        }

        val^=a;
    }

    if (val>0)
    {
        cout<<"NO";
    }
    else cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define long long long

__attribute__((constructor))
void fast_iostream() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}

vector<unordered_map<long, int>> sg(61);

int get_sg(int x, long mask) {
  if (sg[x].find(mask) != sg[x].end()) {
    return sg[x][mask];
  }
  int mex = 0;
  vector<char> has_prev(61, false);
  for (int i = 1; i <= x; ++i) {
    if (mask & (1ll << i)) {
      continue;
    }
    int cur_sg = get_sg(x - i, mask | (1ll << i));
    has_prev[cur_sg] = true;
    while (has_prev[mex]) {
      ++mex;
      // if (mex > 60) {
      //   exit(-1);
      // }
    }
  }
  return sg[x][mask] = mex;
}

int main() {
  int n; cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    ans ^= get_sg(x, 0);
  }

  cout << ((ans == 0) ? "YES": "NO") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define long long long

__attribute__((constructor))
void fast_iostream() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}

vector<unordered_map<long, int>> sg(61);
vector<char> has_prev(61);

int get_sg(int x, long mask) {
  if (sg[x].find(mask) != sg[x].end()) {
    return sg[x][mask];
  }
  int mex = 0;
  fill(has_prev.begin(), has_prev.end(), false);
  for (int i = 1; i <= x; ++i) {
    if (mask & (1ll << i)) {
      continue;
    }
    int cur_sg = get_sg(x - i, mask | (1ll << i));
    has_prev[cur_sg] = true;
    while (has_prev[mex]) {
      ++mex;
      if (mex > 60) {
        exit(-1);
      }
    }
  }
  return sg[x][mask] = mex;
}

int main() {
  int n; cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    ans ^= get_sg(x, 0);
  }

  cout << ((ans == 0) ? "YES": "NO") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define long long long

__attribute__((constructor))
void fast_iostream() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}

vector<unordered_map<long, int>> sg(61);
vector<char> has_prev(61);

int get_sg(int x, long mask) {
  if (sg[x].find(mask) != sg[x].end()) {
    return sg[x][mask];
  }
  int mex = 0;
  fill(has_prev.begin(), has_prev.end(), false);
  for (int i = 1; i <= x; ++i) {
    if (mask & (1 << i)) {
      continue;
    }
    int cur_sg = get_sg(x - i, mask | (1 << i));
    has_prev[cur_sg] = true;
    while (has_prev[mex]) {
      ++mex;
    }
  }
  return sg[x][mask] = mex;
}

int main() {
  int n; cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    ans ^= get_sg(x, 0);
  }

  cout << ((ans == 0) ? "YES": "NO") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define long long long

__attribute__((constructor))
void fast_iostream() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}

vector<unordered_map<long, int>> sg(61);
vector<char> has_prev(61);

int get_sg(int x, long mask) {
  if (sg[x].find(mask) != sg[x].end()) {
    return sg[x][mask];
  }
  int mex = 0;
  fill(has_prev.begin(), has_prev.end(), false);
  for (int i = 1; i <= x; ++i) {
    if (mask & (1ll << i)) {
      continue;
    }
    int cur_sg = get_sg(x - i, mask | (1ll << i));
    has_prev[cur_sg] = true;
    while (has_prev[mex]) {
      ++mex;
    }
  }
  return sg[x][mask] = mex;
}

int main() {
  int n; cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    ans ^= get_sg(x, 0);
  }

  cout << ((ans == 0) ? "YES": "NO") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define long long long

__attribute__((constructor))
void fast_iostream() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}

vector<unordered_map<long, int>> sg(61);
vector<char> has_prev(61);

int get_sg(int x, long mask) {
  if (sg[x].find(mask) != sg[x].end()) {
    return sg[x][mask];
  }
  int mex = 0;
  fill(has_prev.begin(), has_prev.end(), false);
  for (int i = 1; i <= x; ++i) {
    if (mask & (1ll << i)) {
      continue;
    }
    int cur_sg = get_sg(x - i, mask | (1ll << i));
    has_prev[cur_sg] = true;
    while (has_prev[mex]) {
      ++mex;
      if (mex > 60) {
        return -1;
      }
    }
  }
  return sg[x][mask] = mex;
}

int main() {
  int n; cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    ans ^= get_sg(x, 0);
  }

  cout << ((ans == 0) ? "YES": "NO") << endl;
}


#include <bits/stdc++.h>

#define X first
#define Y second
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;

ld p[20001][1001];

signed main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        int c = 0;
        while (x)
        {
            for (int k = 1; k <= 100; k++)
            {
                if (x == 0)
                    break;
                if (x >= k)
                {
                    x -= k;
                    c++;
                    break;
                }
            }
        }
        s ^= c;

    }
    cout << ((!s) ? "YES" : "NO");
    return 14/88;
}


#include <bits/stdc++.h>

#define X first
#define Y second
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;

ld p[20001][1001];

signed main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        int c = 0;

        for (int k = 100; k >= 1; k--)
        {
            if (x >= k*(k + 1)/2)
            {
                c = k;
                break;
            }
        }
        s ^= c;

    }
    cout << ((!s) ? "YES" : "NO");
    return 14/88;
}


#include <bits/stdc++.h>

#define X first
#define Y second
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;

ld p[20001][1001];

signed main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        int c = 0;
        while (x)
        {
            for (int k = 100; k >= 1; k--)
            {
                if (x == 0)
                    break;
                if (x >= k)
                {
                    x -= k;
                    c++;
                    break;
                }
            }
        }
        s ^= c;

    }
    cout << ((!s) ? "YES" : "NO");
    return 14/88;
}


#include <bits/stdc++.h>

#define X first
#define Y second
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;

ld p[20001][1001];

signed main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        int c = 0;

        for (int k = 1; k <= 100; k++)
        {
            if (x == 0)
                break;
            if (x >= k)
            {
                x -= k;
                c++;
                break;
            }
        }
        s ^= c;

    }
    cout << ((!s) ? "YES" : "NO");
    return 14/88;
}


#include <bits/stdc++.h>
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 1e6 + 233;
int n, one, two, a[N];
int sg[100][100], vis[100];
inline int dfs(int n, int mx) {
  if(sg[n][mx] != -1) return sg[n][mx];
  if(n == 0) return 0;
  memset(vis, 0, sizeof vis);
  for(int i = 1; i <= mx; i ++)
    vis[dfs(n - i, i - 1)] = 1;
  int t = 0; while(vis[t]) t ++;
  return sg[n][mx] = t;
}

main(void) {
  memset(sg, -1, sizeof sg);
  read(n);
  fo(i, n) read(a[i]);
  for(int i = 60; i >= 1; i --)
    dfs(i, i);
  int ans = 0; fo(i, n) ans ^= sg[a[i]][a[i]];
  puts(ans ? "NO" : "YES");
}


#include <bits/stdc++.h>
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 1e6 + 233;
int n, one, two, a[N];
int sg[100][100], vis[100];
inline int dfs(int n, int mx) {
  if(sg[n][mx] != -1) return sg[n][mx];
  if(n == 0 || mx <= 0) return 0;
  memset(vis, 0, sizeof vis);
  for(int i = 1; i <= min(n, mx); i ++)
    vis[dfs(n - i, i - 1)] = 1;
  int t = 0; while(vis[t]) t ++;
  return sg[n][mx] = t;
}

main(void) {
  memset(sg, -1, sizeof sg);
  read(n);
  fo(i, n) read(a[i]);
  for(int i = 60; i >= 1; i --)
    dfs(i, i);
  int ans = 0; fo(i, n) ans ^= sg[a[i]][a[i]];
  puts(ans ? "NO" : "YES");
}