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