407063: GYM102697 034 Broken Ladder

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

034. Broken Laddertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You have a broken ladder. Your ladder would normally have $$$n$$$ rungs numbered from 1 to $$$n$$$, but unfortunately some of the rungs have broken off. You can only climb up the ladder if the minimum gap between rungs is less than or equal to some value $$$k$$$. For example, if $$$k$$$ = 1, if the ladder was broken at all, you would not be able to climb the ladder.

Input

The first line of input contains two space-separated positive integers n and k: the number of rungs remaining on the ladder, and the largest gap in rungs that you can climb over, respectively. The second line of input contains a sorted list of $$$n$$$ integers greater than or equal to 1: the positions of the rungs of the ladder. You can assume that the first and last rungs of the ladder are not broken.

Output

Output "YES" if you can still climb the broken ladder, otherwise "NO". (no quotes)

ExamplesInput
6 2
1 2 3 5 6 8
Output
YES
Input
5 3
1 3 8 12 13
Output
NO

加入题单

算法标签: