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 == M == 1) or (N == M and len(A) == 1): MA = 1 MI = 1 else: MA = len(A) MI = 0 print(MA, MI)