#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int q, r, g, b, w;
  cin >> q;
  while (q--) {
    vector<int> a(4);
    int odd = 0, even = 0;
    for (int i = 0; i < 4; i++) {
      cin >> a[i];
      if (a[i] % 2)
        odd += 1;
      else
        even += 1;
    }
    if (odd <= 1)
      cout << "YES\n";
    else {
      if (min(a[0], min(a[1], a[2])) >= 1) {
        odd = 0, even = 0;
        for (int i = 0; i < 3; i++) {
          a[i] -= 1;
          if (a[i] % 2)
            odd += 1;
          else
            even += 1;
        }
        a[3] += 1;
        if (a[3] % 2)
          odd += 1;
        else
          even += 1;
        if (odd <= 1)
          cout << "YES\n";
        else
          cout << "NO\n";
      } else {
        cout << "NO\n";
      }
    }
  }
}
