f=lambda:[*map(int,input().split())] N,M=f() p=f() n=len(set(p)) print(n,(n==1 and N==M)&1)