Score : 300 points
There are N integers written on a blackboard. The i-th integer is A_i.
Takahashi will repeatedly perform the following operation on these numbers:
Determine whether it is possible to have only one integer on the blackboard.
The input is given from Standard Input in the following format:
N A_1 A_2 … A_N
If it is possible to have only one integer on the blackboard, print YES
. Otherwise, print NO
.
3 1 2 3
YES
It is possible to have only one integer on the blackboard, as follows:
5 1 2 3 4 5
NO