def is_valid_battleship_field(field):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    
    def is_valid_ship_placement(row, col, size, direction):
        if direction == "horizontal":
            for i in range(size):
                if field[row][col + i] != '.':
                    return False
        else:
            for i in range(size):
                if field[row + i][col] != '.':
                    return False
        return True
    
    for size in ship_sizes:
        found = False
        for i in range(10):
            for j in range(10):
                if field[i][j] == '.':
                    if (j + size <= 10 and is_valid_ship_placement(i, j, size, "horizontal")) or (i + size <= 10 and is_valid_ship_placement(i, j, size, "vertical")):
                        found = True
                        if size > 1:
                            for k in range(size):
                                if j + k < 10:
                                    field[i][j + k] = '#'
                                else:
                                    field[i + k][j] = '#'
                        else:
                            field[i][j] = '#'
                        break
        if not found:
            return "NO"
    return "YES"

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

result = is_valid_battleship_field(field)
print(result)
