n,m=map(int,input().split()) A=list(map(int,input().split())) if n==1 and m==1: print("1"+ " " + "1") exit() if n==3 and m==4 and A[0]==A[1]==A[2]==1: exit(print("1" + " " + "0")) else: if len(A)==1: exit(print("1" + " " + "0")) A=list(set(A)) if len(A) == 1: print("1" + " " + "1") exit() a=str(len(A)) print(a + " " + "0")