302439: CF470B. Hexakosioihexekontahexaphobia
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
B. Hexakosioihexekontahexaphobiatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
This (unpronounceable) word means simply fear of number 666.
You are given a string of digits. Check whether it is scary for a person suffering from this phobia, i.e., whether it contains number 666 as a substring.
InputThe input will consist of a single string p. The string contains between 1 and 100 digits ('0'-'9'), inclusive. The string doesn't contain any other characters except digits.
OutputOutput "YES" if given string contains number 666, and "NO" otherwise (quotes for clarity only).
ExamplesInput123098Output
NOInput
16660Output
YESInput
1606061Output
NONote
Note that 666 must be a contiguous substring of p, not a subsequence (see sample 3).