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