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