n, m = map(int, input().split()) a = list(map(int, input().split())) max_ = len(set(a)) min_ = 0 if m == n and len(set(a)) == 1: min_ = 1 print(max_, min_)