package xyz.liuyingdi.test;

import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int testTimes = sc.nextInt();
            for(int i = 0; i < testTimes; i++) {
                int n = sc.nextInt();
                int a = sc.nextInt();
                int b = sc.nextInt();
                int c = sc.nextInt();
                System.out.println(solve(n, a, b, c));
            }
        }
    }
    
    public static String solve(int n, int a, int b, int c) {
        
        boolean flag = true;
        for(int i = 0; i < n; i++) {
            if(c >= 2) {  // 0 0 2
                c -= 2;
            }
            else if(c >= 1 && b >= 1 && a >= 1) {  // 1 1 1
                c -= 1;
                b -= 1;
                a -= 1;
            }
            else if(c >= 1 && a >= 3) {  // 3 0 1
                c -= 1;
                a -= 3;
            }
            else if(b >= 3) {  // 0 3 0
                b -= 3;
            }
            else if(b >= 2 && a >= 2) {  // 2 2 0
                b -= 2;
                a -= 2;
            }
            else if(b >= 1 && a >= 4) {  // 4 1 0
                b -= 1;
                a -= 4;
            }
            else if(a >= 6) {  // 6 0 0
                a -= 6;
            }
            else {
                flag = false;
                break;
            }
        }
        
        String str = flag ? "Yes" : "No";
        return str;
    }
}