#K41692. Odd Sum Subsequence
Odd Sum Subsequence
Odd Sum Subsequence
Given a sequence of integers, determine whether there exists a contiguous subsequence whose sum is odd. Notice that a single element is also considered as a contiguous subsequence. In other words, the task is to check if there is at least one odd number in the sequence.
If there exists at least one odd element, then the answer is "YES"; otherwise, the answer is "NO".
The mathematical condition for an integer a to be odd is given by: \(a \bmod 2 \neq 0\).
inputFormat
The input is read from stdin and consists of two lines:
- The first line contains a single integer \(n\) (\(1 \leq n \leq 10^5\)) representing the number of elements in the sequence.
- The second line contains \(n\) space-separated integers, each integer representing an element of the sequence.
outputFormat
Output to stdout a single line containing either "YES" if there exists a contiguous subsequence whose sum is odd, or "NO" if there is no such subsequence.
## sample5
1 2 3 4 5
YES
</p>