N, M = map(int, input().split()) A = list(map(int, input().split())) vmax = len(set(A)) if M < N: vmin = 1 else: vmin = 0 print(vmax, vmin)