import sys input = sys.stdin.readline from collections import * N, M = map(int, input().split()) A = list(map(int, input().split())) M = len(set(A)) if N==M and A==[A[0]]*N: m = 1 else: m = 0 print(M, m)