from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N, M = map(int, input().split()) A = list(map(int, input().split())) max_ = len(set(A)) if max_ == 1 and N == M: min_ = 1 else: min_ = 0 print(max_, min_) main()