#Lutece2686. F_know's Binary Matrix

F_know's Binary Matrix

Migrated from Lutece 2686 F_know's Binary Matrix

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

F_know invites you to play an interesting game on a binary matrix with 10610^6 rows and 10610^6 columns, consisting of either 00 or 11. Initially, the number of 11 is nn.

Now he gives you an integer kk and you can do the following operation on the matrix any number (possibly zero) of times you want.

  • Choose a contiguous submatrix of size k×1k\times 1 or 1×k1\times k.
  • Flip every number in the submatrix. That is, if it is 00, change it to 11, and vice versa.

Your goal is to make all numbers in the matrix become 00. Determine whether you can do it or not.

Input

The first line contains two integers nn and kk (0n105,1k1030\le n \le 10^5,1\le k \le 10^3), denoting the initial number of 11 and the size of the submatrix.

For the next nn lines, each line contains two integers xx and yy (1x,y1061\le x,y\le 10^6), denoting that a number 11 locates at xx-th row and yy-th column. It's guaranteed that all the positions in the input are distinct.

Output

If you can make all numbers become 00, output YES\texttt{YES}. Otherwise, output NO\texttt{NO}.

Samples

4 2
1 1
1 3
1 4
2 2
YES
4 3
2 2
1 3
3 3
3 1
NO

Note

In the first example, you can make it by the following steps.

In the second example, it's impossible to achieve the goal.

Resources

电子科技大学第十二届 ACM 趣味程序设计竞赛