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