N, M = list(map(int, input().split())) A = list(map(int, input().split())) max_ = len(set(A)) if N == M and len(set(A)) == 1: min_ = 1 else: min_ = 0 print(max_, min_)