题库练习 A Blend of Springtime
← 上一题 下一题 →

A11817 | A Blend of Springtime

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

When the curtains are opened, a canvas unfolds outside. Kanno marvels at all the blonde colours along the riverside — not tangerines, but blossoms instead."What a pity it's already late spring," sighs Mino with regret, "one more drizzling night and they'd be gone."

"But these blends are at their best, aren't they?" Absorbed in the landscape, Kanno remains optimistic.





The landscape can be expressed as a row of consecutive cells, each of which either contains a flower of colour amber or buff or canary yellow, or is empty.

When a flower withers, it disappears from the cell that it originally belonged to, and it spreads petals of its colour in its two neighbouring cells (or outside the field if the cell is on the side of the landscape). In case petals fall outside the given cells, they simply become invisible.

You are to help Kanno determine whether it's possible that after some (possibly none or all) flowers shed their petals, at least one of the cells contains all three colours, considering both petals and flowers. Note that flowers can wither in arbitrary order.

输入格式

The first and only line of input contains a non-empty string $s$ consisting of uppercase English letters 'A', 'B', 'C' and characters '.' (dots) only ( $\lvert s \rvert \leq 100$ ) — denoting cells containing an amber flower, a buff one, a canary yellow one, and no flowers, respectively.

输出格式

Output "Yes" if it's possible that all three colours appear in some cell, and "No" otherwise.

You can print each letter in any case (upper or lower).

输入输出样例

输入 #1
.BAC.
输出 #1
Yes
输入 #2
AA..CB
输出 #2
No
C++ 编辑器
输入
输出