#C11071. Complete the Circle
Complete the Circle
Complete the Circle
Alice is participating in a track event where she must complete one full circle by jumping over every hurdle exactly once and returning to the start. Given a track with ( n ) hurdles arranged in clockwise order and a maximum jump height ( h ), determine whether Alice can clear all hurdles. For each hurdle ( h_i ), she can jump over it if ( h_i \leq h ). If all hurdles satisfy this condition, output YES
, otherwise output NO
.
inputFormat
The first line contains two integers ( n ) and ( h ) separated by a space, where ( n ) is the number of hurdles and ( h ) is Alice's maximum jump height. The second line contains ( n ) space-separated integers representing the heights of the hurdles in clockwise order.
outputFormat
Output a single line: YES
if Alice can jump over all hurdles and complete the circle, or NO
otherwise.## sample
5 10
1 3 2 6 5
YES