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