~/algor $ cat problems/massiv-hammasi-tengmi
Are all elements equal?
Easy
1000 ms
128 MB
28%
A positive integer $n$ and an array of $n$ integers are given. If all elements of the array are equal to each other, print YES, otherwise NO.
Input
The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.
Output
YES or NO accordingly.
Note
$1 \le n \le 10^{4}$
$-1000 \le a_{i} \le 1000$
Examples
Input #1
4 7 7 7 7
Output #1
YES
Input #2
3 7 7 8
Output #2
NO