#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, X: "List[int]", Y: "List[int]", S: str):
    check_dict = {}

    for i in range(N):
        if check_dict.get(Y[i]) is None:
            check_dict[Y[i]] = {S[i]: [X[i]]}
        elif check_dict[Y[i]].get(S[i]) is not None:
            ys = check_dict[Y[i]].get(S[i])
            ys.append(X[i])
        else:
            y = check_dict[Y[i]]
            y[S[i]] = [X[i]]

    # print(check_dict)

    for c in check_dict:
        if len(check_dict[c]) >= 2:
            # print(check_dict[c])

            min_r = min(check_dict[c].get('R'))
            max_l = max(check_dict[c].get('L'))
            
            if min_r < max_l:
                print(YES)
                return
    print(NO)

    return


# Generated by 2.12.0 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int()] * (N)  # type: "List[int]"
    Y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        X[i] = int(next(tokens))
        Y[i] = int(next(tokens))
    S = next(tokens)  # type: str
    solve(N, X, Y, S)

if __name__ == '__main__':
    main()
