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