Yeongu Dorm Cleaning

A knight moves mold around an N by N board for exactly t days; report whether any of K inspected cells holds mold at day t.

Medium6BFSGraphImplementationSimulationNo attempts yetTime limit1sMemory limit512 MB

Problem

There is a room of size NxNN x N. Rows and columns are numbered from 11 to NN. Initially, MM cells contain mold.

Each day, all mold spreads simultaneously. Mold at (x,y)(x, y) disappears, and new mold appears in up to 88 cells reachable by a knight move, namely (x+1,y+2)(x+1, y+2), (x+1,y2)(x+1, y-2), (x1,y+2)(x-1, y+2), (x1,y2)(x-1, y-2), (x+2,y+1)(x+2, y+1), (x+2,y1)(x+2, y-1), (x2,y+1)(x-2, y+1) and (x2,y1)(x-2, y-1). Positions outside the room are lost. If several molds spread to the same cell, that cell contains mold.

Inspection happens exactly tt days from today. If any of the KK inspected cells contains mold, cleaning is required. Decide whether cleaning is required.

Input

The first line contains NN, MM, KK and tt separated by spaces. (1<=N<=3001 <= N <= 300, 0<=M<=NxN0 <= M <= N x N, 0<=K<=NxN0 <= K <= N x N, 1<=t<=100001 <= t <= 10000)

Each of the following MM lines contains the initial mold position MxMx, MyMy. (1<=Mx,My<=N1 <= Mx, My <= N)

Each of the following KK lines contains an inspected position KxKx, KyKy. (1<=Kx,Ky<=N1 <= Kx, Ky <= N)

Output

Print YES if cleaning is required, otherwise print NO.