n, m = map(int, input().split()) if n == 1: print(1, 1) else: print(len(set(list(map(int, input().split())))), 0)