The Internet Computer Parts Company (ICPC) is an online shop that sells computer parts. One of its best sellers is a set of two in-line electrical connectors. Packaging mistakes send customers connectors that do not fit each other, so this set is also the part that gets returned the most.
An in-line connector has five connection points, labelled 1 to 5. Each connection point is either a plug or an outlet. Two connectors are compatible when, at every label, one connection point is a plug and the other is an outlet, so a plug meets an outlet everywhere the two connectors touch.
ICPC is installing an Automated Checking Machine (ACM) with an optical checker that verifies whether the two connectors packed for a customer really are compatible. The expensive hardware is finished and the software is still missing.
Given the description of a pair of in-line connectors, decide whether they are compatible.
The first line contains five integers X1,X2,…,X5 separated by spaces, describing the connection points of the first connector. The second line contains five integers Y1,Y2,…,Y5 in the same format, describing the second connector. Every value satisfies 0≤Xi≤1 and 0≤Yi≤1, where 0 is an outlet and 1 is a plug.
Print one line with the uppercase letter Y if the connectors are compatible, and the uppercase letter N otherwise.