Good red-string
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

We define a string consisting of several disjoint red sequences as a ''good red-string''.
For example, rerded is a good red-string , because it can be performed as rerded, which can consist of 2 disjoint red sequences. Inversely, redrde is not a good red-string.

Now you are given a string with characters 'r','e','d' and '?'. You can replace '?' with 'r','e' or 'd' arbitrarily. Please determine if the string can be defined as a good red-string.

输入描述:

Each test contains multiple test cases. The first line contains the number of test cases T (). Description of the test cases follows.

Each test case has a string s, consisting of 'r','e','d' and '?'.

It's guaranteed that for each case is divisible by 3, and the sum of over all test cases does not exceed .

输出描述:

For each test case, print a single line containing "Yes" if the given string can be defined as a good string and "No" otherwise.

You can print letters in any case (upper or lower).
示例1

输入

复制
6
????dd
???
??d
redder
?e?
r??e?d

输出

复制
Yes
Yes
Yes
No
Yes
Yes

说明

"r??e?d" can be a good red-string like "rreedd" or "reredd".