P25409 [AtCoder] DDCC-type String
普及
题目描述

Problem Description

A string of length $4$ is considered a DDCC-type string if the first and second characters are equal, the second and third characters are different, and the third and fourth characters are equal.

Given a string $S$ of $4$ characters, output Yes if it is a DDCC-type string, otherwise output No.

Input Format

The input is given from the standard input in the following format:

$ S $

Output Format

Output Yes if $S$ is a DDCC-type string, otherwise output No.

Sample Input and Output

Sample Input #1

DDCC

Sample Output #1

Yes

Sample Input #2

AAAA

Sample Output #2

No

Sample Input #3

ABCD

Sample Output #3

No

Notes/Hints

Constraints

  • $ |S| = 4 $
  • The input consists of uppercase English letters.

Sample Explanation 1

The first and second characters of $S$ are equal, the second and third characters are different, and the third and fourth characters are equal, so $S$ is a DDCC-type string.

Sample Explanation 2

The second and third characters of $S$ are equal, so $S$ is not a DDCC-type string.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
DDCC
样例输出
Yes