import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') n,m = map(int,input().split()) a = list(map(int,input().split())) print(len(set(a)),1 if len(set(a))==1 or m-len(set(a)) >= n else 0)