The electrical outlet is designed as follows: it has two contacts, each connected to a wire. These contacts (and the wires attached to them) are called "phase" and "neutral," respectively. On the exterior panel of the outlet, there are two holes for connecting electrical devices.
Electrical devices are connected to the outlet using plugs. Each plug has two contacts that are inserted into the holes of the outlet. When the plug is inserted, the corresponding contacts of the plug and the outlet are connected.
In different countries, plugs are produced with varying distances between their contacts, causing significant inconvenience for travelers. A major company decided to produce a universal outlet into which the plug from almost any country can be inserted. This outlet has holes. Some of the holes are connected to neutral, and the rest are connected to phase.
Your task is to determine whether it is possible to connect a plug with a contact distance of to this outlet so that one contact is connected to neutral and the other to phase.
The first line contains two integers and (1 \leq n \leq 200, 1 \leq d \leq 10000).
Introduce a rectangular Cartesian coordinate system on the outlet's exterior panel. The following lines each contain three integers x_i, y_i, t_i (-10000 \leq x_i, y_i \leq 10000; 0 \leq t_i \leq 1). This means that there is a hole at coordinates x_i, y_i. If t_i = 1, this hole is connected to phase. If t_i = 0, this hole is connected to neutral.
All holes are at unique coordinates.
Print Yes if it is possible to correctly connect the plug to the outlet, and No otherwise.
Example 1
Example 2