import sys input = sys.stdin.readline N,M=map(int,input().split()) A=list(map(int,input().split())) MAX=len(set(A)) MIN=0 if N==M and len(set(A))==1: MIN=1 print(MAX,MIN)