def is_valid_battleship_board(board):
    ship_lengths = {'#': 0, '.': 0}
    ship_counts = {'#': 0, '.': 0}

    for row in board:
        for cell in row:
            if cell not in ['#', '.']:
                return "NO"

            if cell == '#':
                ship_lengths['#'] += 1
                if ship_lengths['#'] > 4:
                    return "NO"
            else:
                if ship_lengths['#'] > 0:
                    ship_counts[ship_lengths['#']] += 1
                ship_lengths['#'] = 0

    if ship_lengths['#'] > 0:
        ship_counts[ship_lengths['#']] += 1

    if ship_counts[1] != 4 or ship_counts[2] != 3 or ship_counts[3] != 2 or ship_counts[4] != 1:
        return "NO"

    return "YES"

board = [input() for _ in range(10)]
result = is_valid_battleship_board(board)
print(result)
