I have create a logout confirmation message with Yes or No option.
A button called Logout calls a popup page and the popup page contains two buttons Yes and No.
Yes button on click set to sign out and No button on click set to close page.
What do you think?
You have mentioned about buttons and not text.
If that just YES/NO button on popup page, definately not a good choice. As that does not intend any meaning.
If you have some text which was not mentioned in your comment then you approach is good!
In the popup message, using "Are you sure you want to log out?" with buttons "YES" and "NO" may provide a more explicit and intuitive choice for users, improving clarity. Both approaches are acceptable, but the latter option in the popup message may be slightly better for user understanding.