#CCBCHBAHAI0000064. Kiểm tra mọi phần tử bằng nhau (Check Whether All Elements Are Equal)
Kiểm tra mọi phần tử bằng nhau (Check Whether All Elements Are Equal)
Check Whether All Elements Are Equal (Kiểm tra mọi phần tử bằng nhau)
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given an integer array
the array is called all-equal if
Determine whether the given array is all-equal. For , the condition is always true.
Input
The first line contains . The second line contains .
Output
Print YES if all elements are equal; otherwise print NO.
Subtask
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , .
Example
Input
5
7 7 7 7 7
Output
YES
Explanation
The sample follows the mathematical definition above.