n, m = map(int, input().split()) A = list(map(int, input().split())) print(len(set(A)), int(len(set(A)) == 1 and n == m))