Domino
You and your friends agreed to play "Among Us". At the appointed time, everyone entered the game. Everyone except Arseniy, who, as always, is late. Being in the waiting room, you decided to play a virtual domino game, which was added in experimental mode in the latest game update.
Since the mode is still experimental, the game is as primitive as possible: there are two dominoes on the table. Each domino is a rectangle divided into two halves. Each half of the domino contains from zero to six dots. Players need to determine if these two dominoes can be combined. Dominoes can be matched if and only if there exists a non-negative integer such that exactly dots are drawn on at least one of the halves of each domino.
This game seemed too primitive to you, so you decided to write a program that will automatically win it. Do it!
Input
Consists of two lines, each of which contains a description of the domino. The description of a domino consists of several dots (character ".", ASCII code ) and exactly one vertical bar (character "|", ASCII code ) . The dots on one side of the vertical line lie in one half of the domino, and on the other — in the second half.
It is guaranteed that each half of each domino contains from to dots.
Output
Print "Yes" if the dominoes can be combined, and "No" otherwise.