O=print L=range(8) A=[[int(s)for s in input()]for i in L] def U(t,a,i): return[t[(j+a)&7]-A[i][j]for j in L] def N(t): return any(t[j]<0for j in L) for a in L: t=U(A[0],a,1) if N(t):continue for b in L: u=U(t,b,2) if N(u):continue for c in L: v=U(u,c,3) if N(v):continue for d in L: w=U(v,d,4) if N(w):continue for e in L: x=U(w,e,5) if N(x):continue for f in L: y=U(x,f,6) if N(y):continue for g in L: if U(y,g,7)==[0]*8:exit(O("Yes")) O("No")