Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

D. Dactylic Hexameter
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Opening of the Odyssey (I 1–10). London, British Library, Harley MS 6325, f. 1r; third quarter of the 15th c.

Poetry sometimes is set in dactylic hexameter. Henry

Longfellow's poem Evangeline is an example of this form:

This is the meter the Odyssey uses, as written by Homer.

Syllables either are longa or brevis, the former are stressed, the

latter are not. Two or three of these syllables make up a foot. A

spondee consists of two longae (like "daylight"). Trochees (like "meter")

start with a longa, but then comes a brevis. A dactyl consists of

longa, then brevis, then brevis (like "beautiful"), named for the finger.

Lines must begin with five feet each of which is a dactyl or spondee;

last in the line (at foot six) is a trochee or else just a spondee.

Input shows longa as hyphen and brevis as lowercase "u". You're

given a line of such symbols and need to decide if it's truly

valid dactylic hexameter—or not.

Input

The input consists of:

  • One line with a string $$$s$$$ ($$$1 \leq |s| \leq 100$$$) consisting only of the characters '-' and 'u', describing a line consisting of longae or breves.
Output

Output "yes" if $$$s$$$ is in dactylic hexameter, and "no" otherwise.

Examples
Input
-uu-uu---uu-uu-u
Output
yes
Input
-uu-uu-uu-uu-uu-uu
Output
no
Input
------------
Output
yes
Input
uuuuuuuuuuuu
Output
no