N, M = map(int, input().split()) A = [int(i) for i in input().split()] A = set(A) MA, MI = 0, 0 # 1 <= N <= M <= 2 * 10 ^5 if N == 1 and M == 1: MA = 1 MI = 1 exit() elif M > 1: MA = len(A) MI = 0 print(MA, MI)