All Tracks Basic Programming Implementation Basics of Implementation Problem

Min-Max
Tag(s):

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
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala 2.11.8, Swift, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications