An integer array, is a list of integer numbers without any specific order, where even its elements can be repeated.
A beautiful array, is an array of integers that contains at least once, all the integers between the smaller and the greatest number that is in the array.
Given an integer array, could you tell if it is beautiful?
Input has two lines. The first line contains an integer N (\(1 \leq N \leq 1000\)), the length of the array. The second line contains N integer numbers \(a_{i}\) (\(1 \leq a_{i} \leq 100\)) separated by a blank space, the elements of the array.
Print YES if the array is beautiful, otherwise NO.