mod=998244353 #N,Q=map(int, input().split()) import heapq from heapq import heappop,heappush,heapify from sys import stdin, setrecursionlimit input = stdin.readline readline = stdin.readline N,M=map(int, input().split()) A=list(map(int, input().split())) if M==0: for i in range(N): print(N-i) exit() C=[0]*(N+2) D=[0]*M S=set() for i in range(M): S.add(i) r=0 for i in range(N): while r!=N and len(S)!=0: a=A[r] if a