from collections import Counter N,M = map(int,input().split()) A = list(map(int,input().split())) C = Counter(A).values() MAX = len(C) if len(C) == 1 and N == M: MIN = 1 else: MIN = 0 print(MAX,MIN)