import collections N,M = map(int, input().split()) A = list(map(int, input().split())) CA = collections.Counter(A) print(len(CA),int(len(CA)==1 and N==M))