def is_valid_ship_placement(field):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    ship_count = [0] * 10

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                ship_size = 0
                if i < 9 and field[i + 1][j] == '#':
                    while i < 10 and field[i][j] == '#':
                        i += 1
                        ship_size += 1
                elif j < 9 and field[i][j + 1] == '#':
                    while j < 10 and field[i][j] == '#':
                        j += 1
                        ship_size += 1
                else:
                    ship_size = 1

                if ship_size not in ship_sizes:
                    return "NO"

                ship_count[ship_sizes.index(ship_size)] += 1

    return "YES" if ship_count == [1, 2, 3, 4, 0, 0, 0, 0, 0, 0] else "NO"

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