import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; /** * http://www.codechef.com/AUG14/problems/CRAWA * * @author sultan.of.swing * */ public class Main { public PrintWriter mOut; public FasterScanner mFScanner; public static final String sYes = "YES"; public static final String sNo = "NO"; public Main() { mOut = new PrintWriter(System.out); mFScanner = new FasterScanner(); } public void solve() { int T; int x; int y; boolean ans; T = mFScanner.nextInt(); while (T-- > 0) { ans = false; x = mFScanner.nextInt(); y = mFScanner.nextInt(); ans = firstQuadrant(x, y) | secondQuadrant(x, y) | thirdQuadrant(x, y) | fourthQuadrant(x, y); if (ans) mOut.println(sYes); else mOut.println(sNo); } } public boolean firstQuadrant(int x, int y) { int mul; int xL; int yL; if (!(x >= 0 && y >= 0)) return false; if (x == 0 && y == 0) return true; if (x == 1 && y == 0) return true; if (x % 2 == 1) { // Odd x-coordinate yL = x + 1; if (y <= yL) return true; } if (y % 2 == 0) { // Even y-coordinate xL = y - 1; if (x <= xL) return true; } return false; } public boolean secondQuadrant(int x, int y) { int xL, yL; if (!(x <= 0 && y >= 0)) return false; x = Math.abs(x); if (x % 2 == 0) { yL = x; if (y <= yL) return true; } if (y % 2 == 0) { xL = y; if (x <= xL) return true; } return false; } public boolean thirdQuadrant(int x, int y) { int xL, yL; if (!(x <= 0 && y <= 0)) return false; x = Math.abs(x); y = Math.abs(y); if (x % 2 == 0) { yL = x; if (y <= yL) return true; } if (y % 2 == 0) { xL = y; if (x <= xL) return true; } return false; } public boolean fourthQuadrant(int x, int y) { int xL, yL; if (!(x >= 0 && y <= 0)) return false; y = Math.abs(y); if (x % 2 == 1) { yL = x - 1; if (y <= yL) return true; } if (y % 2 == 0) { xL = y + 1; if (x <= xL) return true; } return false; } public void flush() { mOut.flush(); } public void close() { mOut.close(); } public static void main(String[] args) { Main mSol = new Main(); mSol.solve(); mSol.flush(); mSol.close(); } } class FasterScanner { private InputStream mIs; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public FasterScanner() { this(System.in); } public FasterScanner(InputStream is) { mIs = is; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = mIs.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public String nextLine() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isEndOfLine(c)); return res.toString(); } public String nextString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public int nextInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } }