n, m = map(int, input().split()) A = list(map(int, input().split())) ans = set(A) if len(ans) == 1 and n == m: print(1, 1) else: print(len(ans), 0)