N, M = map(int, input().split()) s = [int(input(), 2) for _ in range(M)] ok = True if 0 not in s or (1<