You talked to Polycarp and asked him a question. You know that when he wants to answer "yes", he repeats Yes many times in a row.

Because of the noise, you only heard part of the answer — some substring of it. That is, if he answered YesYes, then you could hear esY, YesYes, sYes, e, but you couldn't Yess, YES or se.

Determine if it is true that the given string $s$ is a substring of YesYesYes... (Yes repeated many times in a row).


-----Input-----

The first line of input data contains the singular $t$ ($1 \le t \le 1000$) — the number of test cases in the test.

Each test case is described by a single string of Latin letters $s$ ($1 \le |s| \le 50$) — the part of Polycarp's answer that you heard, where $|s|$ — is the length of the string $s$.


-----Output-----

Output $t$ lines, each of which is the answer to the corresponding test case. As an answer, output "YES" if the specified string $s$ is a substring of the string YesYesYes...Yes (the number of words Yes is arbitrary), and "NO" otherwise.

You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).


-----Examples-----

Input
12
YES
esYes
codeforces
es
se
YesY
esYesYesYesYesYesYe
seY
Yess
sY
o
Yes
Output
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
NO
YES


-----Note-----

None

Difficulty: EASY

Solutions:
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input().strip()
	t = 'Yes' * 18
	if s in t:
		print('YES')
	else:
		print('NO')


test = int(input())
ans = []
for _ in range(test):
	sub = input()
	got = False
	aaa = 'Yes' * 1000
	if sub in aaa:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


for i in range(int(input())):
	s = input()
	k = s.count('Yes')
	s1 = ''.join('Yes' * (k + 2))
	if s in s1:
		print('YES')
	else:
		print('NO')


t = 'Yes'
for s in [*open(0)][1:]:
	print('YNEOS'[(t[:t.find(s[0])] + s[:-1] + t[t.find(s[-2]) + 1:]).replace(t, '') > ''::2])


n = int(input())
for i in range(n):
	t = 20 * 'Yes'
	a = input()
	if a in t:
		print('YES')
	else:
		print('NO')


string = 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes'
for _ in range(int(input())):
	print('YES' if input() in string else 'NO')


a = int(input())
s = ''
for i in range(100):
	s += 'Yes'
for j in range(a):
	b = input()
	if b in s:
		print('YES')
	else:
		print('NO')


t = int(input())
l = []
for y in range(t):
	ch = input()
	test = 'Yes' * len(ch)
	if ch in test:
		l.append('YES')
	else:
		l.append('NO')
for i in l:
	print(i)


s = []
for i in range(int(input())):
	s.append(input())
for j in s:
	if j in 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes':
		print('YES')
	else:
		print('NO')


a = 'Yes' * 50
for _ in range(int(input())):
	b = input()
	if b in a:
		print('YES')
	else:
		print('NO')


s = 'Yes' * 100
for _ in range(int(input())):
	a = input()
	if a in s:
		print('YES')
	else:
		print('NO')


t = int(input())
s = 'Yes' * 100
for i in range(t):
	if input() in s:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
ans = 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes'
for _ in range(t):
	s = input()
	if s in ans:
		print('YES')
	else:
		print('NO')


st = 'Yes' * 50
tc = int(input())
for t in range(0, tc):
	inp = str(input())
	if inp in st:
		print('YES')
	else:
		print('NO')


val = 'YesYes' * 100
res = ''
for i in range(int(input())):
	s = input()
	res += 'YES\n' if s in val else 'NO\n'
print(res)


n = int(input())
for i in range(n):
	s = input()
	if s in 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes':
		print('YES')
	else:
		print('NO')


t = int(input())
answers = []
for i in range(t):
	x = input()
	s = 'Yes' * (len(x) // 3 + 3)
	if x in s:
		answers.append('YES')
	else:
		answers.append('NO')
for i in answers:
	print(i)


t = str()
for i in range(20):
	t = t + 'Yes'
for _ in range(int(input())):
	s = input()
	if t.find(s) == -1:
		print('NO')
	else:
		print('YES')


TT = int(input())
ss = 'Yes' * 33
while TT:
	s = input()
	if s in ss:
		print('YES')
	else:
		print('NO')
	TT -= 1


for _ in range(int(input())):
	s = 'Yes' * 51
	temp = input()
	if temp in s:
		print('YES')
	else:
		print('NO')


t = int(input())
z = 'Yes' * 50
for _ in range(t):
	s = input()
	if z.find(s) == -1:
		print('NO')
	else:
		print('YES')


def solve():
	data = 'Yes' * 100
	a = input()
	print('YES') if a in data else print('NO')
for i in range(int(input())):
	solve()


r = ''
for i in range(50):
	r = r + 'Yes'
for i in range(int(input())):
	s = input()
	if s in r:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	s = input()
	if s in 'Yes' * 50:
		print('YES')
	else:
		print('NO')


n = int(input())
ss = 'Yes' * 30
for _ in range(n):
	s = input()
	if s in ss:
		print('YES')
	else:
		print('NO')


t = int(input())
str = ''
for i in range(500):
	str += 'Yes'
while t > 0:
	t -= 1
	s = input()
	if s in str:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	n = len(s)
	s1 = 'Yes' * ((n + 5) // 3)
	if s in s1:
		print('YES')
	else:
		print('NO')


import heapq
import itertools
import heapq as hq
import math
import bisect as bs
from collections import deque
from queue import PriorityQueue as pq
from collections import defaultdict
from collections import Counter
import sys
input = lambda : sys.stdin.readline().rstrip()
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
inf = 2 ** 63 - 1
for _ in range(ii()):
	s = str(input())
	p = 'Yes' * 1000
	if s in p:
		print('YES')
	else:
		print('NO')


t = input()
longYes = 'Yes' * 20
for line in range(int(t)):
	line = input()
	if line in longYes:
		print('YES')
	else:
		print('NO')


t = int(input())
yes = 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes'
for _ in range(t):
	s = input()
	n = len(s)
	if s in yes:
		print('YES')
	else:
		print('NO')


def calc(i):
	if i in len(i) * 'Yes':
		return 'YES'
	return 'NO'
l = []
for _ in range(int(input())):
	l.append(input())
for i in l:
	print(calc(i))


ref = ''.join(['Yes' for i in range(50)])
t = int(input())
for _ in range(t):
	s = input()
	if s in ref:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
output = sys.stdout.write

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def outp(num):
	output(str(num) + '\n')

def outlt(lst):
	output(' '.join(lst) + '\n')

def outsr(st):
	output(''.join(st) + '\n')

def solution():
	n = inp()
	cases = [insr() for _ in range(n)]
	for case in cases:
		if ''.join(case) in 'Yes' * 50:
			outsr('YES')
		else:
			outsr('NO')
solution()


for _ in range(int(input())):
	s = input()
	l = 'Yes'
	l1 = l * 20
	if s in l1:
		print('YES')
	else:
		print('NO')


import sys
readline = sys.stdin.readline
T = int(readline())
Yes = 'Yes' * 100
for _ in range(T):
	s = readline().rstrip()
	if s in Yes:
		print('YES')
	else:
		print('NO')


t = int(input())
for p in range(t):
	flag = True
	s = input()
	n = len(s)
	if not (s[0] == 'Y' or s[0] == 'e' or s[0] == 's'):
		flag = False
	for i in range(n - 1):
		if s[i] == 'Y':
			if s[i + 1] != 'e':
				flag = False
				break
		elif s[i] == 'e':
			if s[i + 1] != 's':
				flag = False
				break
		elif s[i] == 's':
			if s[i + 1] != 'Y':
				flag = False
				break
		else:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


yes = 'Yes' * 100
for i in range(int(input())):
	sent = input()
	if sent in yes:
		print('YES')
	else:
		print('NO')


lst = []
n = int(input())
for i in range(0, n):
	x = input()
	lst.append(x)
stg = 'Yes' * 50
for j in lst:
	if j in stg:
		print('YES')
	else:
		print('NO')


i = int(input())
for c in range(i):
	s = input()
	if s in 'Yes' * (len(s) // 3 + 2):
		print('YES')
	else:
		print('NO')


from math import ceil
t = int(input())
while t:
	s = input()
	n = ceil(len(s) / 3) + 1
	cmp = 'Yes' * n
	if s in cmp:
		print('YES')
	else:
		print('NO')
	t -= 1


n = int(input())
lists = ['Yes'] * 20
aim = ''.join(lists)
for i in range(n):
	tmp = input()
	if tmp in aim:
		print('YES')
	else:
		print('NO')


l = ['Y', 'e', 's']

def f(s):
	if len(s) == 1:
		if s[0] not in l:
			return 'NO'
	for i in range(len(s) - 1):
		if s[i] not in l:
			return 'NO'
		if s[i] == 'Y':
			if s[i + 1] != 'e':
				return 'NO'
		elif s[i] == 'e':
			if s[i + 1] != 's':
				return 'NO'
		elif s[i + 1] != 'Y':
			return 'NO'
	return 'YES'
for _ in range(int(input())):
	s = input()
	print(f(s))


import sys
sys.setrecursionlimit(10 ** 7)
mod = 10 ** 9 + 7

def readInt():
	return int(input())

def readIntList():
	return list(map(int, input().split()))

def readStringList():
	return list(input())

def readStringListWithSpace():
	return list(input().split())

def readString():
	return input()

def execute():
	t = readInt()
	for _ in range(t):
		s = readStringList()
		res = True
		if s[0] != 'Y':
			if s[0] == 'e':
				s.insert(0, 'Y')
			elif s[0] == 's':
				s.insert(0, 'e')
				s.insert(0, 'Y')
			else:
				res = False
		if s[-1] != 's':
			if s[-1] == 'e':
				s.append('s')
			elif s[-1] == 'Y':
				s.append('e')
				s.append('s')
		l = len(s)
		if l % 3 != 0:
			res = False
		else:
			expected = ['Yes' for _ in range(l // 3)]
			expected = ''.join(expected)
			s = ''.join(s)
			if expected != s:
				res = False
		if res:
			print('YES')
		else:
			print('NO')
execute()


for i in range(int(input())):
	s = input()
	stroka = 'Yes' * len(s)
	if s in stroka:
		print('YES')
	else:
		print('NO')


import math
n = int(input())
for i in range(n):
	s = input()
	nYes = math.ceil(len(s) / 3) + 1
	sYes = 'Yes' * nYes
	if s in sYes:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	s = input()
	f = ''
	for i in range(len(s) // 3 + 2):
		f += 'Yes'
	a = f.find(s)
	if a == -1:
		print('NO')
	else:
		print('YES')


y = 'Yes' * 100
t = int(input())
for x in range(t):
	s = input()
	if s in y:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	s = input()
	t = 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes'
	if s in t:
		print('YES')
	else:
		print('NO')


import sys
from collections import *
sys.setrecursionlimit(10 ** 5)
itr = (line for line in sys.stdin.read().strip().split('\n'))
INP = lambda : next(itr)

def ni():
	return int(INP())

def nl():
	return [int(_) for _ in INP().split()]
n = ni()
o = ['Y', 'e', 's']
for l in range(n):
	a = list(INP())
	p = True
	s = a[0]
	ind = 0
	if s in o:
		ind = o.index(s)
	else:
		p = False
	for c in a:
		if c == o[ind]:
			ind += 1
			ind = ind % 3
		else:
			p = False
	if p:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	s = input()
	print('YES' if s in 'YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes' else 'NO')


t = int(input())
st = ''
for i in range(50):
	st += 'Yes'
for i in range(t):
	x = input()
	if st.find(x) == -1:
		print('NO')
	else:
		print('YES')


s = 'Yes'
l = s * 75
for i in range(int(input())):
	strr = input()
	if strr in l:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	s = input()
	string = len(s) * 'Yes'
	print('YES' if s in string else 'NO')


for _ in range(int(input())):
	s = input()
	a = s.count('Y')
	ss = 'Yes' * (a + 1)
	if s in ss:
		print('YES')
	else:
		print('NO')


t = int(input())
lst_input = []
max_size = 1
for i in range(t):
	x = input()
	lst_input.append(x)
	max_size = max(max_size, len(x))
string_yes = ''
max_size_3 = int((max_size - max_size % 3) / 3) + 1
for i in range(max_size_3):
	string_yes += 'Yes'
string_yes += 'YesYesYesYes'
for i in lst_input:
	if i in string_yes:
		print('YES')
	else:
		print('NO')


a = 'Yes' * 50
for i in range(int(input())):
	x = input()
	if x in a:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input().strip()
	n = len(s) // 3 + 2
	m = ''
	for i in range(n):
		m += 'Yes'
	print('YES' if s in m else 'NO')


t = int(input())
st = 'Yes' * 100
for _ in range(t):
	s = input()
	if st.find(s) != -1:
		print('YES')
	else:
		print('NO')


t = int(input())
lst = []
for i in range(t):
	lst.append(str(input()))
for each in lst:
	s = 'Yes' * len(each)
	if s.find(each) != -1:
		print('YES')
	else:
		print('NO')


import sys
sys.setrecursionlimit(10 ** 6)

def main() -> int:
	readline = lambda : sys.stdin.readline().strip()
	t = int(readline())
	ss = [readline() for _ in range(t)]
	yes = 'Yes' * 20
	for s in ss:
		if s in yes:
			print('YES')
		else:
			print('NO')
	return 0
exit(main())


y = 'Yes' * 50
for x in range(int(input())):
	s = input()
	if s in y:
		print('YES')
	else:
		print('NO')


string = 'Yes' * 50
for _ in range(int(input())):
	inp = input()
	if inp in string:
		print('YES')
	else:
		print('NO')


ans = []
for _ in range(int(input())):
	s = input()
	if s in 'Yes' * 51:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans, sep='\n')


t = int(input())
a = 'YesYesYes'
for i in range(t):
	s = input()
	while len(s) > 6 and 'Yes' in s:
		s = s.replace('Yes', '', 1)
	if len(s) == 0 or s in a:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
arr = []
maxLen = 0
for i in range(t):
	tempStr = list(map(str, input().split()))[0]
	maxLen = max(maxLen, len(tempStr))
	arr.append(tempStr)
n = maxLen // 3 + 2
temp = 'Yes' * n
for i in range(t):
	if arr[i] in temp:
		print('YES')
	else:
		print('NO')


t = int(input())
a = []
for i in range(t):
	j = input()
	l = len(j)
	store = 'YesYes' * (l // 3 + 1)
	if j in store:
		print('YES')
	else:
		print('NO')


s = 'Yes' * 50
t = int(input())
while t:
	tmp = input()
	if tmp in s:
		print('YES')
	else:
		print('NO')
	t -= 1


n = int(input())
for i in range(n):
	s = input()
	a = 'Yes' * 60
	if s in a:
		print('YES')
	else:
		print('NO')


for _ in range(0, int(input())):
	s = '#' + input()
	c = 'Yes'
	n = 0
	flag = True
	if s[1] == 'Y':
		n = 0
	if s[1] == 'e':
		n = 1
	if s[1] == 's':
		n = 2
	for i in range(1, len(s)):
		if s[i] != c[n]:
			print('NO')
			flag = False
			break
		n += 1
		if n == 3:
			n = 0
	if flag:
		print('YES')


for i in range(int(input())):
	str = input()
	strr = 'Yes' * len(str)
	if str in strr:
		print('YES')
	else:
		print('NO')


n = int(input())
r = ''
for i in range(100):
	r += 'Yes'
l = []
for i in range(n):
	s = input()
	if r.__contains__(s) == True:
		l.append('YES')
	else:
		l.append('NO')
for i in range(n):
	print(l[i])


for t in range(int(input())):
	s = input().strip()
	if s.replace('Y', '').replace('e', '').replace('s', '') or 'se' in s or 'Ys' in s or ('eY' in s) or ('YY' in s) or ('ee' in s) or ('ss' in s):
		print('NO')
	else:
		print('YES')


t = int(input())
s = 'Yes' * 50
while t > 0:
	st = input()
	if st in s:
		print('YES')
	else:
		print('NO')
	t = t - 1


s = 'Yes' * 50
n = int(input())
for i in range(n):
	st = input()
	if st in s:
		print('YES')
	else:
		print('NO')