Hopping Rabbit
题号:NC223734
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Little Rabbit loves hopping. He always hops around on the grassland. But dangers are lurking there --- the hunters have set  traps. Once Little Rabbit falls into a trap, his life will be threatened. Therefore, Little Rabbit has to keep away from those traps.

Let's use two-dimensional Cartesian coordinate system to describe the grassland. We can regard Little Rabbit as a point, and regard traps as rectangles on the plane. The sides of the rectangles are parallel to the coordinate axes. We use two points to describe a rectangle --- the lower left point  and the upper right point  ( are all integers).

Little Rabbit can hop in the direction of -axis or -axis. The length of each hop is . Formally, if Little Rabbit locates at , he can then hop to  or .

Little Rabbit wants to find an initial position  ( and  are integers) so that when he starts to hop from this point, no matter how he hops, he will never fall into a trap. Please help Little Rabbit to find such a point.

Please note that during a hop, Little Rabbit is in the air and won't fall into a trap. Little Rabbit will fall into a trap only if his landing point is in a trap.

输入描述:

The first line contains two integers  and  () --- the number of traps and the length of each hop.

Then in the next  lines, each line contains four integers  () --- the lower left point and the upper right point of the rectangle.

It's possible that the rectangles will intersect with each other.

输出描述:

If there exist valid answers, output YES in the first line. Then output two integers  () separated by a space in the second line, indicating a valid initial position . If there are multiple answers, output any.

If there are no valid answers, output NO in a single line.

示例1

输入

复制
2 2
1 1 2 2
2 2 3 3

输出

复制
YES
3 2
示例2

输入

复制
1 1
1 1 2 2

输出

复制
NO