#K43247. All Ingredients Usage Check
All Ingredients Usage Check
All Ingredients Usage Check
You are given an integer representing the number of ingredients and a list of integers. Each integer is either 0 or 1, where 0 indicates a non-conflicting ingredient and 1 indicates a conflicting ingredient. Your task is to determine if all ingredients can be used without any conflicts. In other words, if any ingredient is marked as conflicting (i.e., equals 1), then the output should be 'NO'; otherwise, output 'YES'.
The solution should read input from standard input (stdin) and output the result to standard output (stdout).
inputFormat
The first line contains an integer , the number of ingredients. The second line contains space-separated integers (each either 0 or 1) representing the status of each ingredient.
outputFormat
Output a single line containing the string 'YES' if none of the ingredients are conflicting, otherwise output 'NO'.## sample
4
0 0 0 0
YES
</p>