#!/usr/bin/env python3 import sys MOD = 998244353 def main(): N, M = map(int, input().split()) A = set(map(int, input().split())) if M == N: if len(A) == 1: print(len(A), 1) else: print(len(A), 0) else: print(len(A), 0) return if __name__ == '__main__': main()