Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0.

Constraints

* $1 \leq N \leq 10^5$
* $1 \leq K \leq 10^5$
* $1 \leq a_i \leq 10^5$

Input

The input is given in the following format.

$N$ $K$
$a_1$ $a_2$ ... $a_N$

Output

Print the smallest sub-array size in a line.

Examples

Input

6 2
4 1 2 1 3 5


Output

2


Input

6 3
4 1 2 1 3 5


Output

3


Input

3 4
1 2 3


Output

0

Solution (in PYTHON3):

Solution:
#!/usr/bin/env python3
# DSL_3_B: The Smallest Window II


class Window:
    def __init__(self, k):
        self.k = k
        self.data = [0] * k
        self.zeros = set(range(k))

    def add(self, i):
        if self.data[i-1] == 0:
            self.zeros.remove(i-1)
        self.data[i-1] += 1

    def remove(self, i):
        if self.data[i-1] == 1:
            self.zeros.add(i-1)
        self.data[i-1] -= 1

    def removable(self, i):
        return self.data[i-1] > 1

    def open(self):
        return len(self.zeros) == 0


def run():
    n, k = [int(x) for x in input().split()]
    li = [int(x) for x in input().split()]
    w = Window(k)
    i = 0
    min_ = n+1
    for j, v in enumerate(li):
        if v <= k:
            w.add(v)
            while True:
                if li[i] > k:
                    pass
                elif w.removable(li[i]):
                    w.remove(li[i])
                else:
                    break
                i += 1
            if w.open():
                if min_ > j - i + 1:
                    min_ = j - i + 1

    if min_ > n:
        print(0)
    else:
        print(min_)


if __name__ == '__main__':
    run()