Double Rainbow
문제
Let be a set of points on the -axis and each of the points is colored with one of the colors . For each color 𝑖 of the 𝑘 colors, there is at least one point in which is colored with . For a set of consecutive points from , if both and contain at least one point of each color, then we say that makes a double rainbow. See the below figure as an example. The set 𝑃 consists of ten points and each of the points is colored by one of the colors , , , and . The set of the five consecutive points contained in the rectangle makes a double rainbow.
Given a set of points and the number of colors as input, write a program that computes and prints out the minimum size of that makes a double rainbow.
입력
Your program is to read from standard input. The input starts with a line containing two integers and (1 ≤ k ≤ n ≤ 10,000), where is the number of the points in and is the number of the colors. Each of the following lines consists of an integer from to , inclusively, and the -th line corresponds to the color of the -th point of from the left.
출력
Your program is to write to standard output. Print exactly one line. The line should contain the minimum size of that makes a double rainbow. If there is no such , print 0.
예제
예제 1
10 4 1 2 3 1 1 4 2 4 3 3
5
예제 2
6 3 1 1 2 2 3 3
0