Separate selected objects from DOF without using mask?

Hi there!

I have a problem and I would like to know if someone can help me.
In one scene, I have two characters, each in a different plane of focus and with a low aperture to blur the background. One of them, where I adjust the focus distance, comes out perfect, but the other, being a little behind, goes out of focus.

Is there a way to exclude the object from being affected by the DOF without using masks?

Thanks in advance for your time and I hope you have a nice week!