def is_valid_battleship_field(field):
    ship_counts = {1: 4, 2: 3, 3: 2, 4: 1}
    
    for size in ship_counts:
        for row in range(10):
            for col in range(10):
                if field[row][col] == "#":
                    if (col + size <= 10 and all(field[row][col+i] == "#" for i in range(size))) or \
                       (row + size <= 10 and all(field[row+i][col] == "#" for i in range(size))):
                        ship_counts[size] -= 1
                        if ship_counts[size] < 0:
                            return "NO"
    
    return "YES" if all(count == 0 for count in ship_counts.values()) else "NO"

field = [input() for _ in range(10)]

print(is_valid_battleship_field(field))
