N,M = list(map(int,input().split())) A = list(map(int,input().split())) count = [0] * (M+1) kind = 0 for i in A: if count[i] == 0: count[i] += 1 kind += 1 if N == M and kind == 1: _min = 1 else: _min = 0 print(kind,_min)