mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N, M = map(int, input().split()) A = list(map(int, input().split())) if N != M: print(len(set(A)), 0) else: if len(set(A)) == 1: print(len(set(A)), 1) else: print(len(set(A)), 0) if __name__ == '__main__': main()