```
set<int> numbers;
char userLetter;
int userNumber;

cout << "Please enter a letter: ";
cin >> userLetter;

while(userLetter == 'X')
{
     cout << "Please enter a number: ";
     cin >> userNumber;

     if (numbers.find(userNumber) != numbers.begin())
     {
          cout << "Invalid!";
          continue;
     }
     else
     {
          numbers.insert(userNumber);
     }

     if(userNumber == 2)
          cout << "Yes :)";
     else
          cout << "No :(";

     cout << "Please enter a letter: ";
     cin >> userLetter;
}

```

This is what happens when I run the program:

```
Please enter a letter: X
Please enter a number: 2
Yes :)
Please enter a letter: X
Please enter a number: 2
Yes :)
Please enter a letter: X
Please enter a number: 2
Yes :)
...

```

Of course, the "X" and "2" are things that I enter. When I enter the second 2, shouldn't the program output "Invalid"?

Any help?