N,M=map(int,input().split())
A=list(map(int,input().split()))

A_card=len(set(A))

if N==M and A_card==1:
    print(1,1)
else:
    print(A_card,0)