N, M = map(int, input().split()) A = list(map(int, input().split())) max, min = len(set(A)), 0 if max == 1 and N == M: min = 1 print(max, min)