import sys def main(): n = int(sys.stdin.readline()) m = int(sys.stdin.readline()) has_zero = [False] * n has_one = [False] * n for _ in range(m): s = sys.stdin.readline().strip() for i in range(n): c = s[-(i+1)] # Rightmost is position 1 (0-based from end) if c == '0': has_zero[i] = True else: has_one[i] = True # Check all pairs i < j for i in range(n): for j in range(i + 1, n): # Condition 1: Either i or j has both 0 and 1 cond1 = (has_zero[i] and has_one[i]) or (has_zero[j] and has_one[j]) if cond1: continue # Condition 2: i and j have different bit sets (one is all 0, the other all 1) # Check if both are either all 0 or all 1, and they are different i_all_single = (has_zero[i] ^ has_one[i]) # Either all 0 or all 1 j_all_single = (has_zero[j] ^ has_one[j]) if i_all_single and j_all_single and (has_zero[i] != has_zero[j]): continue # If neither condition is met, answer is No print("No") return print("Yes") if __name__ == "__main__": main()