def main() -> None:
    N, M = map(int, input().split())
    K = len(set(map(int, input().split())))
    print(K, int(N == M and K == 1))


if __name__ == '__main__':
    main()