Birthday Cake

Given up to 50 candle points and up to 15 cuts, decide whether the cuts carve the cake so that every resulting piece holds exactly one candle.

Medium5GeometryBit manipulationCombinatoricsBrute forceInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

John's parents made him a huge birthday cake for his birthday. Dinner is over, so it is time to eat the cake. There are nn candles on the cake. John wants to cut the cake into nn pieces so that every piece carries exactly one candle and no piece is left over. He made mm straight cuts across the cake. Check whether his cuts divide the candles the way he wants.

The cake is a circle of radius rr centered at (0,0)(0, 0). The candles are nn distinct points strictly inside the circle. Each cut is a straight line ax+by+c=0ax + by + c = 0 given by three coefficients aa, bb, and cc.

Input

The first line has three integers nn (1n501 \le n \le 50), mm (1m151 \le m \le 15), and rr (1r1001 \le r \le 100).

Each of the next nn lines gives the location of one candle as two integers xx and yy (0x2+y2<r0 \le \sqrt{x^2 + y^2} < r).

Each of the next mm lines gives the coefficients of one cut as three integers aa, bb, and cc (0a,b1000 \le |a|, |b| \le 100, 0c200000 \le |c| \le 20000) describing the line ax+by+c=0ax + by + c = 0. The values aa and bb are never both 00.

All candles are distinct and all lines are distinct. No candle lies on a cut. No line misses the cake completely or only touches it at one point. The number of cake pieces stays the same if any one cut is moved by at most 10410^{-4} in any direction. Every candle also stays in the interior of the same piece if it is moved by at most 10410^{-4} in any direction.

Output

Print yes if the cuts divide the cake so that every piece carries exactly one candle. Otherwise print no.