All Tracks Basic Programming Implementation Basics of Implementation Problem

Min-Max
/

Basic Programming, Very-Easy

Problem
Editorial
Analytics

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

SAMPLE INPUT
6
4 2 1 3 5 6
SAMPLE OUTPUT
YES
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

Initializing Code Editor...
Notifications
View All Notifications

?