N,M = map(int,input().split())
A = list(map(int,input().split()))
s = set()
for i in range(N):
    s.add(A[i])
if N == M and len(s) == 1:
    print(1,1)
else:
    print(len(s),0)