#K62727. Taco Fruits Parity
Taco Fruits Parity
Taco Fruits Parity
You are given an integer N representing the number of days, and a sequence of N integers where each integer denotes the number of fruits collected on that day. Your task is to determine if there is at least one day with an even number of fruits and at least one day with an odd number of fruits. In mathematical terms, check if there exists at least one number of the form \(2k\) (even) and another of the form \(2k+1\) (odd) among the given fruits counts. Print YES
if both conditions are met, otherwise print NO
.
inputFormat
The input is given via standard input (stdin) and consists of two lines. The first line contains a single integer N, the number of days. The second line contains N space-separated integers, where each integer represents the number of fruits collected on that day.
outputFormat
Output a single line via standard output (stdout): YES
if there exists at least one even number and one odd number among the fruits counts, otherwise output NO
.
5
1 2 3 4 5
YES