Once there was a painter, an expert in drawing circles on a canvas. As a tasteful painter, he found that if he drew circles according to the following restrictions, the resulting canvas would look like an abstract painting.
- The center of any circle must be a grid point on the x-axis.
- The x-coordinate of any point on any circle must be within the range
.
- The radius of any circle must be a positive integer not exceeding
. - Any two circles have at most
intersection point.
Specially, an empty canvas was also considered an abstract painting, as it broke none of the above restrictions.
There had already been

circles drawn on the canvas, not breaking the above restrictions. The painter could further draw one or more circles on the canvas to get an abstract painting, or he could draw nothing and claim that it was already an excellent abstract painting. He wondered how many different abstract paintings he could possibly get. As the number may be very large, you only need to output it modulo

.
输入描述:
The first line contains two integers
and
(
).
If
, each of the next
lines contains two integers
and
(
), indicating that there was already a circle centering at
with radius
on the plane.
It is guaranteed that the drawn
circles satisfy the above restrictions.
输出描述:
Print the number of different abstract paintings the painter might get, modulo
.