def main(): import sys input=sys.stdin.readline n,m=map(int,input().split()) c=[0]*(m+1) ans=0 for a in list(map(int,input().split())): if c[a]==0: ans+=1 c[a]+=1 print(ans,1 if ans==1 else 0) main()