#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll mod = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    vector<int> a(3);
    for (int i = 0; i < 3; i++) cin >> a[i];
    int w;
    cin >> w;
    sort(begin(a), end(a));
    int ct = 0;
    for (int i = 0; i < 3; i++) {
      if (a[i] % 2 == 0) ct++;
    }
    if (w % 2 == 0) ct++;
    if (ct >= 3) {
      cout << "YES" << endl;
      continue;
    }
    ct = 0;
    if (a[0] > 0) {
      for (int i = 0; i < 3; i++) {
        a[i]--;
        if (a[i] % 2 == 0) ct++;
      }
    }
    w += 1;
    if (w % 2 == 0) ct++;
    if (ct >= 3) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
