def is_valid_battleship_field(field):
    ship_lengths = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    def is_valid_ship_placement(field, ship_length):
        for i in range(10):
            for j in range(10 - ship_length + 1):
                if all(field[i][j+k] == "#" for k in range(ship_length)):
                    for k in range(ship_length):
                        field[i][j+k] = "x"
                    return True
        return False
    for length in ship_lengths:
        if not is_valid_ship_placement(field, length):
            return "NO"
    for row in field:
        if "#" in row:
            return "NO"
    return "YES"
field = [list(input().strip()) for _ in range(10)]
result = is_valid_battleship_field(field)
print(result)
