#include int main() { int n, m; scanf("%d %d", &n, &m); int i; int a[200005]; for (i = 0; i < n; i++) scanf("%d", &a[i]); int b[200005]; for (i = 0; i <= m; i++) b[i] = 0; int ans = 0; for (i = 0; i < n; i++) { if (b[a[i]] == 0) ans++; b[a[i]]++; } printf("%d ", ans); ans = 0; for (i = 0; i <= m; i++) if (b[i] == n) ans = 1; printf("%d\n", ans); return 0; }