Snow White lives in the forest with N dwarfs. Every morning the dwarfs walk to the mine in a single line, and Snow White takes pictures of them.
Each dwarf wears a hat, and each hat color is represented by an integer from 1 to C. If a picture contains K dwarfs and more than half of them wear hats of the same color, the picture is considered pretty.
You are given M pictures taken by Snow White. Each picture is represented by a contiguous interval of dwarfs in the line. For each picture, determine whether it is pretty, and if it is, output the hat color that appears more than half the time.
The first line contains the number of dwarfs N and the number of hat colors C. (3 <= N <= 300,000, 1 <= C <= 10,000)
The second line contains the hat colors of the dwarfs in line order. Each color is a positive integer not greater than C.
The third line contains the number of pictures M. (1 <= M <= 10,000)
Each of the next M lines contains two integers A and B. (1 <= A <= B <= N) This means the picture contains the dwarfs from position A through position B.
Print M lines. If the corresponding picture is not pretty, print no. If it is pretty, print yes X, where X is the hat color that appears in more than half of the pictured dwarfs.