n, m = map(int, input().split()) a = list(map(int, input().split())) ma = len(set(a)) if ma == 1 and n == m: mi = 1 else: mi = 0 print(ma, mi)