#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int ok = 0;
    int cnt = (a & 1) + (b & 1) + (c & 1) + (d & 1);
    if (cnt <= 1) {
      ok = 1;
    }
    for (int i = 0; i < 2; i++) {
      if (a && b && c) {
        a--;
        b--;
        c--;
        d += 3;
        cnt = (a & 1) + (b & 1) + (c & 1) + (d & 1);
        if (cnt <= 1) {
          ok = 1;
        }
      }
    }
    cout << (ok ? "YES\n" : "no\n");
  }
  return 0;
}
