LearnPy Hub
← Arena
EasyRating 900

Arithmetic Sequence?

Print YES if the numbers, in the given order, form an arithmetic sequence (the same difference between neighbours).

Input

n, then n integers.

Output

YES or NO.

Sample 1

Input
5
3 7 11 15 19
Output
YES

Sample 2

Input
4
1 2 4 8
Output
NO
solution.py
Output appears here
Arithmetic Sequence? · Python Arena problem · LearnPy Hub