def check_battleship(board):
    ship_counts=[1,2,3,4]
    for i,count in enumerate(ship_counts, start=1):
        if board.count('#'*i) !=count:
            return False
    for i in range(10):
         for j in range(10):
             if board[i][j]=='#':
                 if (i<9 and board [i+1][j]=='#') or (j<9 and board[j][i+1]=='#'):
                 return False
             return True
board=[input() for_in range(10)]
if check_battleship(board):
    print('YES')
else:
    print('NO')
