beecrowd | 1896

It's Time to Duel!

By Caio Russi, UNOESTE BR Brazil

Timelimit: 1

Duel Monsters is the world's most famous Cards championship. Every duel is played by two players, where each player starts with 8000 Life Points and your Deck. Each card is a monster that has the attributes Attack, Defense and Skill. We are in the final duel with the two greatest duelists of history. On one side Charlinho, a boy who loves to study, but also know feel the heart of the cards. Across Gilmar, which was not created to milk with pear, but is recognized as the Master the Cards. It is the turn of Charlinho, and he has just combine their monsters on the table for the forbidden "Prassódia".

Prassódia is the strongest monster in the game, and when invoked the match is completed on time and the player who invoked wins the duel. To invoke Prassódia is necessary to combine two or more cards on the table by adding attack with attack, defense with defense and skill with skill for the Prassódia attributes informed at the beginning of the duel.

If a Card is chosen to be combined, the attributes of the card must be used in full, being invalid only use the attack or just use the defense or just the skill that card and still being able to use only a part of the attack and/or a part of defense and/or a part of skill. Gilmar is surprised for a moment, because he was the only one who could invoke Prassódia in history, but ends up doubting the move by Charlinho because there were several cards on the table, which would make such a very suspicious move. 

You are the judge of the duel and an excellent programmer was responsible for assessing whether the Charlinho actually managed to invoke or not Prassódia with the cards on the table.

Input

The first row entry contains 4 integers, the first integer n (1 ≤ N ≤ 20) represents the number of cards in the following table by three integers A, D, H (1 ≤ A, D, H, ≤ 1000) representing respectively the attack, defense and the exact skill to invoke Prassódia. Each of the following N lines represent a card of the table, where each row contains the attributes in the order X, Y, Z (1 ≤ X, Y, Z ≤ 50) attack, defense and skill respectively.

Output

The output should contain "Y" if Charlinho can hold a valid combination to invoke Prassódia or "N" otherwise.

Exemplo de Entrada Exemplo de Saída

2 5 20 10
8 10 7
9 10 3

N

3 13 9 15
7 6 5
6 3 10
5 9 15

Y

3 10 10 10
10 10 10
9 4 5
1 6 4

N