def is_valid_battleship_field(field):
    ship_sizes = 4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    occupied = set()
    def can_place_ship(x, y, size, direction):
        if direction == "horizontal":
            for i in range(size):
                if (x, y + i) in occupied:
                    return False
        else:
            for i in range(size):
                if (x + i, y) in occupied:
                    return False
        return True

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                if (i, j) in occupied:
                    return "NO"

                for size in range(1, 5):
                    if can_place_ship(i, j, size, "horizontal"):
                        for k in range(size):
                            occupied.add((i, j + k))
                        ship_sizes[size - 1] -= 1
                        break
                    elif can_place_ship(i, j, size, "vertical"):
                        for k in range(size):
                            occupied.add((i + k, j))
                        ship_sizes[size - 1] -= 1
                        break
                else:
                    return "NO"

    if all(size == 0 for size in ship_sizes):
        return "YES"
    else:
        return "NO"

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

result = is_valid_battleship_field(field)
print(result)
