#d2705. 碰撞2

碰撞2

Collision 2

Problem Description

In the xyxy coordinate system there are NN people. The ii-th person is at position (Xi,Yi)(X_i, Y_i), and all positions are distinct.

We have a string SS of length NN consisting of L and R. Si=S_i = R means the ii-th person faces right, and Si=S_i = L means the ii-th person faces left.

Now everyone starts walking in the direction they face: facing right means xx increases, facing left means xx decreases.

For example, when $(X_1, Y_1) = (2, 3), (X_2, Y_2) = (1, 1), (X_3, Y_3) = (4, 1)$ and S=S = RRL, the movement of the people is as shown in the figure.

We call it a collision when two people walk toward each other and meet at one position. If the people can walk forever, will anyone collide?

Input Format

The first line contains an integer NN;

The next NN lines each contain two integers XiX_i and YiY_i, the position of the ii-th person;

The last line contains a string SS of length NN consisting of L and R.

Output Format

If there will be a collision, output Yes; otherwise output No.

Sample Input 1

3
2 3
1 1
4 1
RRL

Sample Output 1

Yes

Sample Input 2

2
1 1
2 1
RR

Sample Output 2

No

Sample Input 3

10
1 3
1 4
0 0
0 2
0 4
3 1
2 4
4 2
4 4
3 3
RLRRRLRLRR

Sample Output 3

Yes

Constraints

For all data, 2≤N≤2×1052 \leq N \leq 2\times 10^5, 0≤Xi≤1090 \leq X_i \leq 10^9, 0≤Yi≤1090 \leq Y_i \leq 10^9.