At least 5 numbers ABCA

Write a program which given a sequence without sentinel of naturals returns "SI" if in the sequence there are at least five numbers of four digits with the first digit equal to the last digit, and "NO" otherwise.

Input

A sequence of naturals without sentinel.

Output

A line with "SI" or "NO".

Observation

Problem information

Author: PRO1

Generation: 2026-01-25T22:29:27.385Z

© Jutge.org, 2006–2026.
https://jutge.org