#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int r, g, b, w;
    cin >> r >> g >> b >> w;
    bool flag = 0;
    int cnt = 0;
    if (r % 2 == 1) cnt++;
    if (g % 2 == 1) cnt++;
    if (b % 2 == 1) cnt++;
    if (r == 0 || g == 0 || b == 0) flag = 1;
    if (flag) {
      if (cnt > 1 || (cnt == 1 && w % 2 == 1))
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
    } else if (w % 2 == 0) {
      if (cnt == 2)
        cout << "NO" << endl;
      else
        cout << "YES" << endl;
    } else {
      if (cnt == 0)
        cout << "YES" << endl;
      else if (cnt == 1)
        cout << "NO" << endl;
      else if (cnt == 2)
        cout << "YES" << endl;
      else if (cnt == 3)
        cout << "YES" << endl;
    }
  }
  return 0;
}
