N,M=map(int, input().split()) A=list(map(int, input().split())) a=len(set(A)) if N==M and A[0]*M==A: b=1 else: b=0 print(a,b)