L-triominoes

아직 제출이 없습니다시간 제한8초메모리 제한512 MB

문제

Luka stumbled upon a rectangular board of height HH and width WW divided into W×HW \times H unit squares. He quickly noticed that exactly KK of those unit squares are missing.

Interestingly enough, Luka just happens to have an infinite supply of L-shaped triominoes. Is it possible to tile the given board using these triominoes?

We consider the board to be correctly tiled if each unit square of the board is covered by a triomino square. Additionally, triominoes must not cover any of the missing squares, and should not overlap or stick out of the board. Of course, triominoes can be arbitrarily rotated by multiples of 90 degrees.

입력

The first line contains three integers WW, HH and KK (0KWH0 \le K \le W \cdot H) from the task description.

The ii-th of the next KK lines contains two integers x_ix\_i (1x_iW1 \le x\_i \le W) and y_iy\_i (1y_iH1 \le y\_i \le H), representing the coordinates of the ii-th missing square. The given missing squares are pairwise distinct.

출력

If Luka can successfully tile the given board, output "YES" in a single line. Otherwise, output "NO" in a single line.