You are given a string of length consisting of the letters , , , . Each letter represents a direction of movement on a coordinate plane. Starting from the point , you perform a sequence of steps as described by the string . The movement rules for each direction are as follows:
If s[i] = \text{'E'}, move from point to point (x + l_E, y).
If s[i] = \text{'W'}, move from point to point (x - l_W, y).
If s[i] = \text{'N'}, move from point to point (x, y + l_N).
If s[i] = \text{'S'}, move from point to point (x, y - l_S).
In one operation, you are allowed to change any character in the string to its opposite:
E \leftrightarrow W, N \leftrightarrow S.
Determine whether it is possible to perform some operations (possibly, zero) before moving so that, after completing all steps, you return to the starting point .
The first line contains an integer (1 \le t \le 10^5) — the number of cases in one input file.
Each case is described in two lines. The first line contains integers n, l_E, l_W, l_N, l_S (1 \le n \le 5 \cdot 10^5, 1 \le l_E, l_W, l_N, l_S \le 10^9).
The second line contains string of length (s_i \in \{E, W, N, S\}).
It is guaranteed that sum over over all cases doesn't exceed 5 \cdot 10^5.
For each case, output YES (without quotes) if it is possible to return to after doing some operations, and NO (without quotes) otherwise.
You can output YES and NO in any case (for example, strings yES, yes, and Yes will be recognized as a positive response).
Example 1
In the first case, we can in one operation change string to WNSE. Let's simulate our movements described by this string:
After the first step, we are at point (0-1, 0)=(-1, 0);
After the second step, we are at point (-1, 0+1)=(-1, 1);
After the third step, we are at point (-1, 1-1)=(-1, 0);
After the fourth step, we are at point (-1+1, 0)=(0, 0).
So indeed we returned to the starting point.
In the third case, we can change the string to EWW so that we can return to the starting point.
It can be proven that in the second and fourth case it is not possible to change the string so that after completing all steps we return to .
( points): n \le 2;
( points): l_E=l_W=l_N=l_S=1;
( points): n \le 10, t \le 1000;
( points): n \le 3000, t \le 10^4;
( points): l_E, l_W, l_N, l_S \le 10^3;
( points): no additional constraints;