题意:

N堆苹果,先取完的输。。

思路:

反NIM

先手获胜的条件是所有堆都为1并且异或值为0

或者有的堆大于1并且异或值不为0

/* ***********************************************
Author        :devil
Created Time  :2016/5/30 17:35:45
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <stdlib.h>
using namespace std;
int main()
{
    //freopen("in.txt","r",stdin);
    int n,x;
    while(~scanf("%d",&n))
    {
        int f=0,s=0;
        while(n--)
        {
            scanf("%d",&x);
            s^=x;
            if(x>1) f=1;
        }
        if(s&&f||!s&&!f) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}