N,M=map(int,input().split()) A=list(map(int,input().split())) mx=len(set(A)) mn=int(N==M and all([a==A[0] for a in A])) print(mx,mn)