#P2359. Three-Prime Number
Three-Prime Number
Three-Prime Number
A number is called a Three-Prime Number if every set of three consecutive digits forms a prime number greater than $$100$$. For example, the 6-digit number 113797
is a Three-Prime Number because its consecutive three-digit segments, namely $$113$$, $$137$$, $$379$$, and $$797$$, are all prime numbers.
Your task is to determine whether a given number is a Three-Prime Number.
Note: A three-digit segment must satisfy the conditions:
- It is greater than $$100$$.
- It is a prime number.
inputFormat
The input consists of a single line containing a number (without spaces). This number is provided as a string. It is guaranteed that the number has at least three digits.
outputFormat
Output a single line: print Yes
if the number is a Three-Prime Number; otherwise, print No
.
sample
113797
Yes