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