In the near future, most of the society must cycle on exercise bikes in order to earn currency called Merits. Bing is an aspiring dancer, who wishes to be featured on the show Hot Shot, a reality contest where winners are able to forgo the bike riding and live luxuriously. The entry fee for it is M Merits.
Each session of cycling, (denoted by C) earns Bing 2000 Merits. Every time he rests (denoted by R), he loses 500 Merits. To keep him energized throughout his journey, he has to spend 200 Merits on food (denoted by F).
Bing initially has 0 Merits with him. Merits shall be deducted (as mentioned above) even if there’s no credit spare (negative credits).
You are given a string describing Bing’s routine (denoted by S). Can he make it to Hot Shot?
The first line of input contains an integer T denoting the number of test cases.
Each test case consists of two lines; the first line is a string S and the next line contains an integer M.
For each test case, output a single line with the string yes or no.
1 ≤ T ≤ 100
0 ≤ M ≤ 106
Here, the total amount of merits left with Bing, after the deductions, is 6800, which is greater than the entry fee M.
Here, the total amount of merits left with Bing, after deductions, is 3900, which is lesser than the entry fee M.
Here, the total amount of merits left with Bing, after deductions, is -1000, which is lesser than the entry fee M.