LearnPy Hub
← Arena
EasyRating 1050

Even Bread

People stand in a line holding loaves. Each time you give a loaf to someone, you must also give one to a neighbour. Everyone must end with an even number. Print the fewest loaves to give, or NO.

Input

n, then n integers.

Output

One integer or NO.

Sample 1

Input
5
2 3 4 5 6
Output
4

Sample 2

Input
2
1 2
Output
NO
solution.py
Output appears here
Even Bread · Python Arena problem · LearnPy Hub