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