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