a=input()
z=0
for i in range(9):
    b=input()
    for j in range(1, 10):
        if a[j]=='#' and (b[j-1]=='#' or b[j+1]=='#'):
            z=1
            break
    a=b
if z==1:
    print('NO')
else:
    print('YES')
