B - Pentagon Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200

問題文

以下の図で表される正五角形 P があります。

P の点 S_1 と点 S_2 を結ぶ線分と、点 T_1 と点 T_2 を結ぶ線分の長さが等しいか判定してください。

制約

  • S_1,S_2,T_1,T_2A, B, C, D, E のいずれかの文字
  • S_1 \neq S_2
  • T_1 \neq T_2

入力

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

S_1S_2
T_1T_2

出力

P の点 S_1 と点 S_2 を結ぶ線分と、点 T_1 と点 T_2 を結ぶ線分の長さが等しい場合 Yes を、等しくない場合 No を出力せよ。


入力例 1

AC
EC

出力例 1

Yes

P の点 A と点 C を結ぶ線分と、P の点 E と点 C を結ぶ線分の長さは等しいです。


入力例 2

DA
EA

出力例 2

No

P の点 D と点 A を結ぶ線分と、P の点 E と点 A を結ぶ線分の長さは等しくありません。


入力例 3

BD
BD

出力例 3

Yes

Score : 200 points

Problem Statement

A regular pentagon P is shown in the figure below.

Determine whether the length of the line segment connecting points S_1 and S_2 of P equals the length of the line segment connecting points T_1 and T_2.

Constraints

  • Each of S_1, S_2, T_1, and T_2 is one of the characters A, B, C, D, and E.
  • S_1 \neq S_2
  • T_1 \neq T_2

Input

The input is given from Standard Input in the following format:

S_1S_2
T_1T_2

Output

If the length of the line segment connecting points S_1 and S_2 of P equals the length of the line segment connecting points T_1 and T_2, print Yes; otherwise, print No.


Sample Input 1

AC
EC

Sample Output 1

Yes

The length of the line segment connecting point A and point C of P equals the length of the line segment connecting point E and point C.


Sample Input 2

DA
EA

Sample Output 2

No

The length of the line segment connecting point D and point A of P does not equal the length of the line segment connecting point E and point A.


Sample Input 3

BD
BD

Sample Output 3

Yes