#P8466. Call Landlord Decision

    ID: 21641 Type: Default 1000ms 256MiB

Call Landlord Decision

Call Landlord Decision

In the game of Dou Di Zhu, a deck of 54 cards is used, which includes cards from \(\mathtt{A}\) to \(\mathtt{K}\) together with two jokers (one small joker and one big joker). The remaining numeral cards (other than jokers) appear in four copies each. The ranking of the cards is independent of suits and follows the order:

\[ \mathtt{3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < J < Q < K < A < 2 < \text{small joker} < \text{big joker}} \]

At the beginning of the game, 17 cards are dealt to each of the 3 players, and 3 cards are left as the base cards. After sorting their hand in descending order, a player decides whether to call for the landlord based on the quality of their hand.

You will choose to call for the landlord if your hand contains either a Joker Bomb (i.e. both the small and big joker are present) or at least one Bomb (i.e. four cards of the same rank). Otherwise, you will not call for the landlord.

inputFormat

The input consists of a single line containing several card representations separated by a space. The card representations can be one of the following:
'3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A', '2', 'joker', 'JOKER'.
A hand always contains 17 cards.

outputFormat

Output Yes if you should call for the landlord and No otherwise.

sample

10 J Q K A 2 3 4 5 6 7 8 9 joker JOKER 3
Yes