76 atcoder#ABC230B. [ABC230B] Triple Metre
[ABC230B] Triple Metre
Score : points
Problem Statement
A string is said to be a substring of a string when there is a pair of integers and ( that satisfy the following condition.
- The extraction of the -th through -th characters of without changing the order equals .
Let be the concatenation of copies of oxx
.
Given a string , print Yes
if is a substring of , and No
otherwise.
Constraints
- is a string consisting of
o
andx
. - The length of is between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
If satisfies the condition, print Yes
; otherwise, print No
.
xoxxoxxo
Yes
begins like this: oxxoxxoxxoxx
...
Since the extraction of -rd through -th characters of equals , is a substring of , so Yes
should be printed.
xxoxxoxo
No
Since there is no way to extract from a string that equals , is not a substring of , so No
should be printed.
ox
Yes