def check_battleship_placement(board):
    ship_counts = {4: 1, 3: 2, 2: 3, 1: 4}
    def can_place_ship(x, y, size, direction):
        if direction == "horizontal":
            for i in range(size):
                if x + i >= 10 or board[x + i][y] != '.':
                    return False
        else:
            for i in range(size):
                if y + i >= 10 or board[x][y + i] != '.':
                    return False
        return True

    for i in range(10):
        for j in range(10):
            if board[i][j] == '.':
                for size in ship_counts.keys():
                    if can_place_ship(i, j, size, "horizontal"):
                        for k in range(size):
                            if board[i + k][j] != '.':
                                return "NO"
                            board[i + k] = board[i + k][:j] + "#" + board[i + k][j + 1:]
                        ship_counts[size] -= 1
                        if ship_counts[size] == 0:
                            del ship_counts[size]
                        break
                    if can_place_ship(i, j, size, "vertical"):
                        for k in range(size):
                            if board[i][j + k] != '.':
                                return "NO"
                            board[i] = board[i][:j + k] + "#" + board[i][j + k + 1:]
                        ship_counts[size] -= 1
                        if ship_counts[size] == 0:
                            del ship_counts[size]
                        break
    return "YES" if not ship_counts else "NO"

board = [input() for _ in range(10)]
result = check_battleship_placement(board)
print(result)
