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):t=[t[(j+(s>>(3*i-3)&7))&7]-A[i][j]for j in R(8)] b&=t!=[0]*8 print("YNeos"[b::2])