Problem C: Harry the Potter

Harry the potter is a specialised craftsman that produces three kinds of pottery pieces: mugs, bowls, and jars. In order to dry out the newly made pieces he uses a special place out of reach of his beloved pets (owls and snakes). The special place is a long wooden board, balanced on a single point under a tree. The hard part of his job is that he needs extra care when placing and taking pieces off the board, not to unbalance the board and let the pieces fall on the ground.

Since he can only carry two pieces at a time, he must either place (or take) one piece exactly at the middle of the board, or two pieces which distances from the centre of the board is equally proportional to their weight. Pieces can be freely stacked in the board.

Mugs weight 1 unit, bowls weight 2 units, and jars weight 5 units.

Task

You must write a program to determine if a sequence of pottery pieces can be taken off the wooden board without making it fall.

Input

The first line of the input contains two integers N and L. The integer value N denotes the number of remaining lines in the input. The integer L denotes the length of the board.

Each of the following N lines denotes a set of pieces of a given kind in a given place of the board. It contains one integer S, one integer D, and a character C.

The integer S denotes the number of pieces, the integer D denotes the distance from the left end of the board to the piece, the character C may be one of the following characters: 'M' to denote a mug, 'B' to denote a bowl, or 'J' to denote a jar.

Constraints

Output

The output is either Yes or No.

Input Example 1

8 10
1 5 J
1 3 M
1 6 B
2 7 B
1 4 J
1 10 M
1 1 M
1 3 B

Output Example 1

Yes

Input Example 2

2 10
2 4 M
1 6 B

Output Example 2

No