#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int odd_count = 0;
    if (a % 2) odd_count++;
    if (b % 2) odd_count++;
    if (c % 2) odd_count++;
    if (d % 2) odd_count++;
    if (odd_count <= 1) {
      cout << "YES" << endl;
    } else {
      odd_count = 0;
      if (a > 0 && b > 0 && c > 0) {
        a--;
        b--;
        c--;
        d += 3;
        if (a % 2) odd_count++;
        if (b % 2) odd_count++;
        if (c % 2) odd_count++;
        if (d % 2) odd_count++;
        if (odd_count <= 1)
          cout << "YES" << endl;
        else
          cout << "NO" << endl;
      } else
        cout << "NO" << endl;
    }
  }
}
