Heat exchange
After the organizing committee of the olympiad conducted a draw to investigate the cause of the testing system's slowdown on the first day of the competition, three boxes and three differently colored balls—red, green, and blue—were left in the meeting room.
Zebra Hippo found these balls and is now playing the following game:
There are three boxes, numbered consecutively from 0 to 2. Initially, the box numbered 0 contains the red ball (denoted as "R"), the box numbered 1 contains the green ball (denoted as "G"), and the box numbered 2 contains the blue ball (denoted as "B").
The following actions are allowed:
Swap the balls in boxes 0 and 1. This action must be performed exactly p times.
Swap the balls in boxes 0 and 2. This action must be performed exactly q times.
Swap the balls in boxes 1 and 2. This action must be performed exactly r times.
Hippo can choose the order of these actions freely. For example, if (p, q, r) = (2, 1, 0), she can swap the balls in boxes 0 and 1, then swap the balls in boxes 0 and 2, and then swap the balls in boxes 0 and 1 again.
The game is won if, after performing all the required actions, the balls are arranged in the specified position s. This position is given by a string of three different symbols representing the colors of the balls "R", "G", "B", arranged in the order of the box numbers where these balls should be placed. If the balls are arranged differently, the game is lost.
Given p, q, r, and position s, determine if Hippo can win.
Input
The first line of the input file contains three integers p, q, and r, separated by spaces (0 ≤ p, q, r ≤ 10^9). The second line contains the string s, which is a permutation of the string "RGB", that is, one of the following six strings: "RGB", "RBG", "GRB", "GBR", "BRG", or "BGR".
Output
If Hippo can win, output "Yes", otherwise output "No".
Note: In the first example, Hippo can first swap the balls in boxes 0 and 2, turning "RGB" into "BGR", then swap the balls in boxes 0 and 1 to get "GBR", and then swap the balls in boxes 0 and 1 again to return to "BGR".