One way you could do this would be to use the set session value server behavior. You can set the value of the session variable initially to be the regular redirect page, like to the next page in the form.
You would then have another set session server behavior that is triggered on the posted element being yes. You would set this variable to the thank you page.
Then in the code for the insert where the redirect page is specified you can put in your session variable that holds the redirect page.
This will result in the user going to the next page in the form if they selected all the values from the form, or to the thank you page if they selected yes to the one element.