IntermediateRating 1200
Close Duplicates
Print YES if there are two equal values at positions i ≠ j with |i − j| ≤ k.
Input
n k, then n integers.
Output
YES or NO.
Sample 1
Input
4 3 1 2 3 1
Output
YES
Sample 2
Input
4 1 1 0 1 1
Output
YES
Output appears here