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