from collections import defaultdict n,m=map(int,input().split()) A=list(map(int,input().split())) memo=defaultdict(int) memoset=set() for i in range(n): memo[A[i]]+=1 memoset.add(A[i]) kind = len(list(memoset)) ans_mn=0 for key,val in memo.items(): if val>m-n+1: ans_mn+=1 print(kind,ans_mn)