Pocket,
Exactly. The rules say "toward" a frozen ball.
In your illustration the two.
The rules do not address another frozen ball or
a situation where the nine moves as a result of
the cue ball or the two ball being moved. So you
could shoot through the nine as long as it was
toward the two...