Three hats are placed on the heads of three men standing in a line. Each man can only see the men and hats in front of him. In addition, the men all know that the hats came from a bag with 3 red hats and 2 blue hats.

Each man is asked if he knows which color hat he is wearing. The man in the back responds first, "No." Then the man in the middle responds, "No." Finally, the man in front responds, "Yes."

If they are all perfectly logical and telling the truth, what color hat is the man at the front wearing?

This is an old, old riddle. But I don't remember the solution -- but Google knows.

http://puzzles.nigelcoldwell.co.uk/twelve.htm

To determine the color of the hat the man in front is wearing, we need to use logical reasoning and analyze the responses from each man.

Let's go step by step:

1. The man in the back says, "No."
- Since the man in the back can see the hats of the two men in front, if he saw two blue hats, he would immediately know that he is wearing a red hat. But since he says "No," it means he sees at least one red hat in front of him.

2. The man in the middle also says, "No."
- The man in the middle can see the hat of the person in front of him, and he heard the response from the man in the back. If he saw a blue hat in front of him, he would know that he is wearing a red hat because the man in the back said "No" (indicating at least one red hat in front). However, since the man in the middle also says "No," it means he sees a red hat in front of him.

3. Finally, the man in front says, "Yes."
- The man in the front has observed the responses from the two men behind him. He knows that the man in the back saw at least one red hat (since he responded "No"), and the man in the middle also saw a red hat (as he also responded "No"). Therefore, the man in front knows that he is wearing a blue hat.

From the given information, we can conclude that the man in front is wearing a blue hat.