#include <bits/stdc++.h>
using namespace std;
int a[10], t, w;
int main() {
  cin >> t;
  while (t--) {
    cin >> a[0] >> a[1] >> a[2] >> a[3];
    int b = 0;
    for (int i = 0; i <= 3; i++) {
      if (a[i] % 2) b++;
    }
    if (b <= 1)
      cout << "YES" << endl;
    else {
      if (min(a[0], min(a[1], a[2])) && b >= 3)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
