C++ 代码
/*
前提:两人都是绝顶聪明,都采取最优方案
当A开始k1^k2^k3^......^kn == 0时:则下一步异或 != 0, 先手的每次状态异或都是0, 就一定不会赢,反之初始k1^k2^k3^......^kn != 0时,A都会将其变成0,将这个状态丢给B,状态再给A时异或又不等于0,最终先手A一定会赢
*/
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
int n, res = 0;
cin >> n;
while(n--)
{
int x;
cin >> x;
res ^= x;
}
if(res) puts("Yes");
else puts("No");
return 0;
}