Matcom Online Grader
Faculty of Mathematics and Computer Science of University of Havana
ℹ️ We've recently migrated MOG to a new server with a different grader. As a result, some features—especially those related to submission evaluation—might not work correctly. If you encounter any issues, please report them by clicking the exclamation icon in the bottom right corner of the website.
Are you sure you want to participate in this contest ?
If you select a team then virtual participation for other team members will be disabled. So, pick one if and only if your teammates are ready to compete with you.
You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.
Input
The input contains one line with the string S (|S|=4).
Output
If S consists of exactly two kinds of characters which both appear twice in S print "Yes", otherwise print "No" (without the quotes).