OpenKattis
Increasing CP5 Lower Bound (Day 3)

Start

2020-12-08 18:00 AKST

Increasing CP5 Lower Bound (Day 3)

End

2020-12-08 23:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -408 days 4:57:37

Time elapsed

5:00:00

Time remaining

0:00:00

Problem F
Match Game

Match sticks can be used to form digital numbers. The arrangement of matches that forms each digit between ‘0’ and ‘9’ is illustrated in the figure.

/problems/matchgame/file/statement/en/img-0001.jpg

You are given two sequences of digits $X$ and $Y$. There are matches that have been arranged to form the digits in $X$. Can you move exactly one match from them, so that the resulting matches form the other sequence $Y$?

Input

The input contains one line with two sequences of digits $X$ and $Y$. It is guaranteed that $X$ and $Y$ have the same length but are different sequences. Each sequence contains digits between ‘0’ and ‘9’ and has at least one and no more than $12$ digits. A sequence may contain leading zeros.

Output

Output “yes” if it is possible to move exactly one match to change $X$ into $Y$. Otherwise output “no”.

Sample Input 1 Sample Output 1
60 58
yes
Sample Input 2 Sample Output 2
046 040
yes
Sample Input 3 Sample Output 3
1178 1140
no