# coding: utf-8 # Your code here! NM=input() NM=NM.rstrip().split(" ") N=int(NM[0]) M=int(NM[1]) list1=[0 for i in range(N)] for j in range(M): L=input() L=L.rstrip().split(" ") for k in range(N): list1[k]+=int(L[k]) ans=0 num=0 NUM=0 for l in range(1000000000000): if ans==777: print("YES") exit() elif ans>777: ans=ans-list1[NUM] NUM+=1 elif ans<777: if num==N: break else: ans=ans+list1[num] num+=1 print("NO")