Given an integer number and numbers , are there at least two equal numbers at distance at most ? Consider the sequence of ’s circularly, that is, assume that is to the right of .
Input consists of several cases, each with and , followed by . You can assume , , and that each is an integer number between 0 and .
For every case, print “yes” if there is at least a pair
of
’s
with the required condition, and print “no” otherwise.
Input
4 8 10 42 23 33 12 42 17 18 3 8 10 42 23 33 12 42 17 18 4 7 10 42 23 33 12 42 17 3 7 10 42 23 33 12 42 17
Output
yes no yes yes