import sys input = sys.stdin.readline N, M = map(int, input().split()) S = [input().strip() for _ in range(M)] T = set(S) if "1"*N not in T: print("No") exit() for i in range(N): for j in range(i+1, N): si = S[i] sj = S[j] tmp = "" for k in range(N): if si[k]=="1" and sj[k]=="1": tmp+="1" else: tmp+="0" if tmp not in T: print("No") exit() dp = [0 for _ in range(N)] for s in S: for i in range(N): if s[i]=="1": dp[i] = 1 if "0"*N not in T: print("No") exit() dp.reverse() tmp = "".join(map(str, dp)) if tmp not in T: print("No") exit() print("Yes")