Min-Max

3.4

181 votes
Basic Programming, Easy
Problem

Given an array of integers . Check if all the numbers between minimum and maximum number in array exist's within the array .

Print 'YES' if numbers exist otherwise print 'NO'(without quotes).

Input:

Integer N denoting size of array

Next line contains N space separated integers denoting elements in array

Output:

Output your answer

Constraints:

1<= N <= 1000

1<= a[i] <= 100

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?