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 CPP):

Solution:
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
int cnt[200000] = {};
int main(){
    int n,s;
    cin >> n>> s;
    vector<int> hoge;
    REP(i,n){
        int a;
        cin >> a;
        hoge.push_back(a);
    }
    int length = n+1;
    int left = 0;
    int ok = 0;
    for(int i = 0;i < n;++i){
        cnt[hoge[i]]++;
        if(hoge[i] <= s&&cnt[hoge[i]] == 1){
            ok++;
        }
        if(ok >= s){
            while((hoge[left] > s||cnt[hoge[left]] != 1)){
                cnt[hoge[left]]--;
                left++;
            }
            length = min(length,i-left+1);
        }
    }
    if(length == n+1){
        cout << 0 << endl;
    }else cout << length << endl;
    return 0;
}