N,M = map(int,input().split()) A = list(map(int,input().split())) ma = len(set(A)) mi = (1 if len(set(A))==1 and N==M else 0) print(ma,mi)