A - Fifty-Fifty 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MB

配点 : 100

問題文

長さ 4 の英大文字からなる文字列 S が与えられます。 S がちょうど 2 種類の文字からなり、かつ現れる各文字はちょうど 2 回ずつ現れているかどうかを判定してください。

制約

  • S の長さは 4 である
  • S は英大文字からなる

入力

入力は以下の形式で標準入力から与えられる。

S

出力

S がちょうど 2 種類の文字からなり、かつ現れる各文字はちょうど 2 回ずつ現れているなら Yes を、そうでないなら No を出力せよ。


入力例 1

ASSA

出力例 1

Yes

SAS からなり、AS はそれぞれ 2 回ずつ現れます。


入力例 2

STOP

出力例 2

No

入力例 3

FFEE

出力例 3

Yes

入力例 4

FREE

出力例 4

No

Score : 100 points

Problem Statement

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.

Constraints

  • The length of S is 4.
  • S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.


Sample Input 1

ASSA

Sample Output 1

Yes

S consists of A and S which both appear twice in S.


Sample Input 2

STOP

Sample Output 2

No

Sample Input 3

FFEE

Sample Output 3

Yes

Sample Input 4

FREE

Sample Output 4

No