N, M = map(int, input().split()) A = list(map(int, input().split())) vmax = len(set(A)) vmin = 0 if len(set(A)) > 1 else 1 print(vmax, vmin)