  In the paper, we study the problem of recovering the potential from the
spectrum of the Dirichlet boundary value problem for a Sturm--Liouville
equation with frozen argument on a closed set. We consider the case when the
closed set consists of two segments and the frozen argument is at the end of
the first segment. A uniqueness theorem and an algorithm solving the inverse
problem are obtained along with necessary and sufficient conditions of its
solvability. The considered case significantly differs from the one of the
classical Sturm--Liouville operator with frozen argument.
