You are given an array of n integers and a non-negative integer k. Decide whether there exist two indices i < j such that the values are equal (nums[i] == nums[j]) and their positions are close, meaning j - i <= k.
Print YES if such a pair exists, otherwise print NO.
Input format
Line 1: two integers n and k.
Line 2: n space-separated integers, the array.
Output format
One line: YES or NO.
Constraints
- 1 <= n <= 100000
- 0 <= k <= n
- -1000000000 <= each value <= 1000000000