#K66102. Can Vasya Guarantee a Win?
Can Vasya Guarantee a Win?
Can Vasya Guarantee a Win?
Vasya is playing a game where he must determine if he can guarantee a win given an array of integers. In each move, Vasya may select an element from the array, and his winning strategy depends on the parity of these numbers.
In this game, Vasya wins if at least one of the numbers in the array is odd. Formally, given an array of n integers \(a_1, a_2, \dots, a_n\), Vasya wins if there exists an index \(i\) such that \(a_i \bmod 2 = 1\).
inputFormat
The input consists of two lines. The first line contains a single integer \(n\) representing the number of elements in the array. The second line contains \(n\) space-separated integers.
outputFormat
Output a single line containing YES
if there exists at least one odd number in the array (i.e., Vasya can guarantee a win), otherwise output NO
.
3
1 2 3
YES