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