#yuki1692 n,m=map(int,input().split()) l=list(map(int,input().split())) s=len(set(l)) print(s,(s==1 and n==m)&1)