R=range A=[[int(s)for s in input()]for i in R(8)] b=1 for s in R(8**7): t=A[0][:] for i in R(1,8): for _ in R(s>>(i*3-3)&7):t=t[1:]+[t[0]] for j in R(8):t[j]-=A[i][j] b&=t!=[0]*8 print("YNeos"[b::2])