n,m = map(int,input().split()) A = list(map(int,input().split())) MAX = 0 MIN = 0 if n == m and len(set(A)) == 1: MAX = 1 MIN = 1 else: MAX = len(set(A)) print(MAX,MIN)