407209: GYM102697 180 Boring Strings
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
180. Boring Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output This problem is worth 5 points.
You consider a string of text to be boring if it contains only "a" characters and "b" characters. For example, "abbaba" is boring, while "abcccbabc" is not boring.
Given a string, figure out whether or not it is a boring string.
InputThe only line of input contains a single string $$$s$$$, not containing spaces.
OutputIf $$$s$$$ is boring, as described above, output "YES" (no quotes). Otherwise, output "NO".
ExamplesInputaaaaaaOutput
YESInput
ccabbabbddOutput
NOInput
baaaaabadOutput
NOInput
baaaaabbaOutput
YES