package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	s := NewScanner()
	t := s.NextInt()

Next:
	for i := 0; i < t; i++ {
		n := s.NextInt()

		m := make([][]int, n)
		for j := 0; j < n; j++ {
			m[j] = make([]int, n)
			s := s.NextString()
			for k, c := range strings.Split(s, "") {
				if c == "0" {
					m[j][k] = 0
				} else {
					m[j][k] = 1
				}
			}
		}

		for j := 0; j < n; j++ {
			for k := 0; k < n; k++ {
				if m[j][k] == 0 {
					continue
				}

				var good bool
				if j < n-1 {
					if m[j+1][k] == 1 {
						good = true
					}
				}

				if k < n-1 {
					if m[j][k+1] == 1 {
						good = true
					}
				}

				if !good && j != n-1 && k != n-1 {
					fmt.Println("NO")
					continue Next
				}
			}
		}

		fmt.Println("YES")
	}
}

type scanner struct {
	*bufio.Scanner
}

func NewScanner() *scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	return &scanner{s}
}

func (s *scanner) NextInt() int {
	s.Scan()
	i, _ := strconv.Atoi(s.Text())
	return i
}

func (s *scanner) NextInt64() int64 {
	s.Scan()
	i, _ := strconv.ParseInt(s.Text(), 10, 64)
	return i
}

func (s *scanner) NextString() string {
	s.Scan()
	return s.Text()
}


// https://codeforces.com/contest/1355/problem/A
package main

import (
	"bufio"
	"fmt"
	"os"
	"io"
)

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscanln(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}
var (
	n int
	p []string
	good [][]bool
)

func solver() string {
	fmt.Fscanln(input, &n)
	p = make([]string, n)
	good = make([][]bool, n)
	for i := 0; i < n; i++ {
		good[i] = make([]bool, n)
		fmt.Fscanln(input, &p[i])
	}

	for i := 0; i < n; i++ {
		mark(n - 1, i)
		mark(i, n - 1)
	}

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if p[i][j] == '1' && !good[i][j] {
				return "NO"
			}
		}
	}

	return "YES"
}

func mark(i, j int) {
	if p[i][j] == '1' {
		good[i][j] = true
		if i > 0 {
			mark(i - 1, j)
		}
		if j > 0 {
			mark(i, j - 1)
		}
	}
}


// https://codeforces.com/contest/1355/problem/A
package main

import (
	"bufio"
	"fmt"
	"os"
	"io"
)

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscanln(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}
var (
	n int
	p []string
	good [][]bool
)

func solver() string {
	fmt.Fscanln(input, &n)
	p = make([]string, n)
	good = make([][]bool, n)
	for i := 0; i < n; i++ {
		good[i] = make([]bool, n)
		fmt.Fscanln(input, &p[i])
	}

	last := n - 1
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if p[i][j] == '1' {
				if i < last  {
					if p[i + 1][j] != '1' {
						return "NO"
					}
				}

				if j < last  {
					if p[i][j + 1] != '1' {
						return "NO"
					}
				}
			}
		}
	}

	return "YES"
}


// https://codeforces.com/contest/1355/problem/A
package main

import (
	"bufio"
	"fmt"
	"os"
	"io"
)

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscanln(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}
var (
	n int
	p []string
	good [][]bool
)

func solver() string {
	fmt.Fscanln(input, &n)
	p = make([]string, n)
	good = make([][]bool, n)
	for i := 0; i < n; i++ {
		good[i] = make([]bool, n)
		fmt.Fscanln(input, &p[i])
	}

	for i := 0; i < n; i++ {
		mark(n - 1, i)
		mark(i, n - 1)
	}

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if p[i][j] == '1' && !good[i][j] {
				return "NO"
			}
		}
	}

	return "YES"
}

func mark(i, j int) {
	if good[i][j] {
		return
	}
	if p[i][j] == '1' {
		good[i][j] = true
		if i > 0 {
			mark(i - 1, j)
		}
		if j > 0 {
			mark(i, j - 1)
		}
	}
}


// https://codeforces.com/contest/1355/problem/A
package main

import (
	"bufio"
	"fmt"
	"os"
	"io"
)

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscanln(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}
var (
	n int
	p []string
	good [][]bool
)

func solver() string {
	fmt.Fscanln(input, &n)
	p = make([]string, n)
	good = make([][]bool, n)
	for i := 0; i < n; i++ {
		good[i] = make([]bool, n)
		fmt.Fscanln(input, &p[i])
	}

	last := n - 1
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if p[i][j] == '1' {
				if i == last || j == last {
					continue
				}
				if i < last  {
					if p[i + 1][j] == '1' {
						continue
					}
				}

				if j < last  {
					if p[i][j + 1] == '1' {
						continue
					}
				}

				return "NO"
			}
		}
	}

	return "YES"
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
  "strings"
  "strconv"
  "math"
)

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n:= reader.NextInt64()
		aa := make([][]int, n)
		for i:=range aa {
			aa[i]=make([]int, n)
		}

		for i := 0; i < len(aa); i++ {
			line:=reader.NextString();
			split:=strings.Split(line,"")
			for j:=0;j<len(split);j++{
				aa[i][j],_=strconv.Atoi(split[j])
			}
		}
		sol(aa)
	}
}

func sol(aa [][]int) {
	for i:=0;i<len(aa)-1;i++{
		for j:=0;j<len(aa)-1;j++{
			if(aa[i][j]==1){
				if(aa[i+1][j]==0 && aa[i][j+1]==0){
					writer.Printf("NO \n")
					return;
				}
			}
		}
	}
	writer.Printf("YES \n")

}

/*********************** I/O ***********************/

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
	impl.Scan()
	bb := impl.Bytes()
	i := 0
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}
/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}


/*
URL:
https://codeforces.com/contest/1360/problem/E
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int
	n int
	A [][]rune
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		n = ReadInt()

		A = [][]rune{}

		for j := 0; j < n; j++ {
			row := ReadRuneSlice()
			A = append(A, row)
		}

		solve(n, A)
	}
}

func solve(n int, A [][]rune) {
	// 右端を埋める
	for i := 0; i < n; i++ {
		A[i] = append(A[i], '1')
	}
	// 一番下を埋める
	row := []rune{}
	for i := 0; i < n+1; i++ {
		row = append(row, '1')
	}
	A = append(A, row)

	// for i := 0; i < n+1; i++ {
	// 	PrintfDebug("%v\n", string(A[i]))
	// }
	// PrintfDebug("\n")

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if A[i][j] == '1' {
				ok := A[i+1][j] == '1' || A[i][j+1] == '1'
				if !ok {
					fmt.Println("NO")
					return
				}
			}
		}
	}
	fmt.Println("YES")
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}


package main

import . "fmt"

// github.com/EndlessCheng/codeforces-go
func main() {
	var t, n int
o:
	for Scan(&t); t > 0; t-- {
		Scan(&n)
		a := make([][]byte, n)
		for i := range a {
			Scan(&a[i])
		}
		for i, s := range a[:n-1] {
			for j, b := range s[:n-1] {
				if b == '1' && a[i][j+1] == '0' && a[i+1][j] == '0' {
					Println("NO")
					continue o
				}
			}
		}
		Println("YES")
	}
}


package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var t, n int
o:
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n)
		a := make([][]byte, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		vis := make([][]bool, n)
		for i := range vis {
			vis[i] = make([]bool, n)
		}
		var f func(i, j int)
		f = func(i, j int) {
			if a[i][j] != '1' {
				return
			}
			vis[i][j] = true
			if i > 0 {
				f(i-1, j)
			}
			if j > 0 {
				f(i, j-1)
			}
		}
		for j := 0; j < n; j++ {
			f(n-1, j)
		}
		for i := 0; i < n; i++ {
			f(i, n-1)
		}
		for i, row := range a {
			for j, v := range row {
				if v == '1' && !vis[i][j] {
					Fprintln(out, "NO")
					continue o
				}
			}
		}
		Fprintln(out, "YES")
	}
}

func main() { run(os.Stdin, os.Stdout) }


package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var t, n int
o:
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n)
		a := make([][]byte, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		vis := make([][]bool, n)
		for i := range vis {
			vis[i] = make([]bool, n)
		}
		var f func(i, j int)
		f = func(i, j int) {
			if a[i][j] != '1' || vis[i][j] {
				return
			}
			vis[i][j] = true
			if i > 0 {
				f(i-1, j)
			}
			if j > 0 {
				f(i, j-1)
			}
		}
		for j := 0; j < n; j++ {
			f(n-1, j)
		}
		for i := 0; i < n; i++ {
			f(i, n-1)
		}
		for i, row := range a {
			for j, v := range row {
				if v == '1' && !vis[i][j] {
					Fprintln(out, "NO")
					continue o
				}
			}
		}
		Fprintln(out, "YES")
	}
}

func main() { run(os.Stdin, os.Stdout) }


package main

import (
	"fmt"
)

var n int
var a []string
var vis [][]bool

func dfs(i, j int) {
    vis[i][j] = true
    if (i - 1 >= 0 && a[i - 1][j] == '1' && !vis[i - 1][j]) {
        dfs(i - 1, j)
    }
    if (j - 1 >= 0 && a[i][j - 1] == '1' && !vis[i][j - 1]) {
        dfs(i, j - 1)
    }
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for tc := 0; tc < t; tc++ {
		fmt.Scanf("%d\n", &n)
		a = make([]string, n)
		for i := 0; i < n; i++ {
		    fmt.Scanf("%s\n", &a[i])
		}
		vis = make([][]bool, n)
		for i := 0; i < n; i++ {
		    vis[i] = make([]bool, n)
		}
		for i := 0; i < n; i++ {
		    if (a[i][n - 1] == '1' && !vis[i][n - 1]) {
		        dfs(i, n - 1)
		    }
		    if (a[n - 1][i] == '1' && !vis[n - 1][i]) {
		        dfs(n - 1, i)
		    }
		}
		flag := true
		for i := 0; flag && i < n; i++ {
		    for j := 0; flag && j < n; j++ {
		        if (a[i][j] == '1' && !vis[i][j]) {
		            flag = false;
		        }
		    }
		}
		if flag {
		    fmt.Println("YES")
		} else {
		    fmt.Println("NO")
		}
	}
}


package main

import (
	"fmt"
)

var n int
var a []string
var vis [][]bool

func dfs(i, j int) {
    vis[i][j] = true
    if (i - 1 >= 0 && a[i - 1][j] == '1' && !vis[i - 1][j]) {
        dfs(i - 1, j)
    }
    if (j - 1 >= 0 && a[i][j - 1] == '1' && !vis[i][j - 1]) {
        dfs(i, j - 1)
    }
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for tc := 0; tc < t; tc++ {
		fmt.Scanf("%d\n", &n)
		a = make([]string, n)
		for i := 0; i < n; i++ {
		    fmt.Scanf("%s", &a[i])
		}
		fmt.Scanf("\n")
		vis = make([][]bool, n)
		for i := 0; i < n; i++ {
		    vis[i] = make([]bool, n)
		}
		for i := 0; i < n; i++ {
		    if (a[i][n - 1] == '1' && !vis[i][n - 1]) {
		        dfs(i, n - 1)
		    }
		    if (a[n - 1][i] == '1' && !vis[n - 1][i]) {
		        dfs(n - 1, i)
		    }
		}
		flag := true
		for i := 0; flag && i < n; i++ {
		    for j := 0; flag && j < n; j++ {
		        if (a[i][j] == '1' && !vis[i][j]) {
		            flag = false;
		        }
		    }
		}
		if flag {
		    fmt.Println("YES")
		} else {
		    fmt.Println("NO")
		}
	}
}


package main

import (
	"bufio"
	. "fmt"
	"os"
)

var (
	inn = bufio.NewScanner(os.Stdin)
	// in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func main() {
	defer out.Flush()
	inn.Split(bufio.ScanWords)
	for tt := rd(); tt > 0; tt-- {
		n := rd()
		a := make([]string, n)
		for i := 0; i < n; i++ {
			a[i] = rds()
		}
		for i := 0; i < n; i++ {
			for j := 0; j < n; j++ {
				if a[i][j] == '0' {
					continue
				}
				if i != n-1 && j != n-1 && a[i+1][j] == '0' && a[i][j+1] == '0' {
					Fprintln(out, "NO")
					goto next
				}
			}
		}
		Fprintln(out, "YES")
	next:
	}
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func rd() (x int) {
	inn.Scan()
	data := inn.Bytes()
	f := 1
	if data[0] == '-' {
		f = -1
		data = data[1:]
	}
	for _, b := range data {
		x = x*10 + int(b&15)
	}
	return f * x
}
func rdll() (x int64) {
	inn.Scan()
	data := inn.Bytes()
	f := int64(1)
	if data[0] == '-' {
		f = -1
		data = data[1:]
	}
	for _, b := range data {
		x = x*10 + int64(b&15)
	}
	return f * x
}

func rds() string {
	inn.Scan()
	data := inn.Bytes()
	return string(data)
}


package main

import (
	"fmt"
)

func main(){
	var T int
	fmt.Scan(&T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Scan(&n)
		G := make([]string, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&G[i])
		}
		good := true
		for i := 0; i+1 < n; i++ {
			for j := 0; j+1 < n; j++ {
				if G[i][j] == '1' && G[i+1][j] == '0' && G[i][j+1] == '0' {
					good = false
				}
			}
		}
		ans := "NO"
		if good {
			ans = "YES"
		}
		fmt.Println(ans)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	// DEBUG ONLY
	// f, _ := os.Open("data.txt")
	// scanner := bufio.NewScanner(f)

	scanner := bufio.NewScanner(os.Stdin)

	var nCount int
	scanner.Scan()

	fmt.Sscanf(scanner.Text(), "%d", &nCount)

	var n int

	for ; nCount > 0; nCount-- {
		scanner.Scan()
		fmt.Sscanf(scanner.Text(), "%d", &n)
		polygon := make([][]bool, n)

		// create empty polygon
		for i := 0; i < n; i++ {
			polygon[i] = make([]bool, n)
		}

		// read polygon
		for i := 0; i < n; i++ {
			scanner.Scan()
			line := scanner.Text()
			for j := 0; j < n; j++ {
				if line[j] == '1' {
					polygon[j][i] = true
				}
			}
		}

		// test polygon
		res := true
		for x := n - 2; (x >= 0) && res; x-- {
			for y := n - 2; y >= 0; y-- {
				if (polygon[x][y]) && (!polygon[x+1][y]) && (!polygon[x][y+1]) {
					res = false
					break
				}
			}
		}
		if res {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}

}


package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
)

type BufferedWriter interface {
	Printf(format string, a ...interface{})
	Flush()
}

type writerImpl struct {
	*bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
	return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
	impl.Writer.Flush()
}

type WordScanner interface {
	NextInt64() int64
	NextUInt64() uint64
	NextString() string
}

type wordScannerImpl struct {
	*bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
	s := bufio.NewScanner(reader)
	s.Split(bufio.ScanWords)
	// adjust the following size as needed
	// 2 << 17 is good enough to scan strings of len 2*10^5
	// it could go as high as 2 << 26 before cf judge breaks
	size := 2 << 20
	buf := make([]byte, size)
	s.Buffer(buf, size)
	return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt64() int64 {
	impl.Scan()
	bb := impl.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextUInt64() uint64 {
	impl.Scan()
	bb := impl.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func (impl *wordScannerImpl) NextString() string {
	impl.Scan()
	return impl.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

const (
	INF = math.MaxInt64
	MOD = 1e9 + 7
)

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
	defer writer.Flush()
	t := reader.NextInt64()
	for ; t > 0; t-- {
		n := reader.NextInt64()
		a := make([]string, n)
		for i := range a {
			a[i] = reader.NextString()
		}
		writer.Printf("%s\n", sol(a))
	}
}

func sol(a []string) string {
	n := len(a)
	for i := range a {
		for j := range a[i] {
			b := a[i][j]
			if b == '1' && i != n-1 && j != n-1 {
				if a[i+1][j] == '0' && a[i][j+1] == '0' {
					return "NO"
				}
			}
		}
	}
	return "YES"
}


ans = []
for _ in range(int(input())):
    v, c, n, m = map(int, input().split())
    if v + c < n + m or m > v or \
       (v - m == n - c != 0 and v > n > m):
        ans.append('No')
    else:
        ans.append('Yes')
print('\n'.join(ans))


ans = []
for _ in range(int(input())):
    v, c, n, m = map(int, input().split())
    if v + c < n + m:
        ans.append('No')
    else:
        if m <= min(v, c):
            ans.append('Yes')
        else:
            ans.append('No')
print('\n'.join(ans))


ans = []
for _ in range(int(input())):
    v, c, n, m = map(int, input().split())
    if v + c < n + m or m > v:
        ans.append('No')
    else:
        ans.append('Yes')
print('\n'.join(ans))


from collections import Counter
import string
import math
import sys
from fractions import Fraction
def array_int():
    return [int(i) for i in sys.stdin.readline().split()]
def vary(arrber_of_variables):
    if arrber_of_variables==1:
        return int(sys.stdin.readline())
    if arrber_of_variables>=2:
        return map(int,sys.stdin.readline().split())
def makedict(var):
    return dict(Counter(var))
# i am noob wanted to be better and trying hard for that
def printDivisors(n):
    divisors=[]
    # Note that this loop runs till square root
    i = 1
    while i <= math.sqrt(n):

        if (n % i == 0) :

            # If divisors are equal, print only one
            if (n//i == i) :
                divisors.append(i)
            else :
                # Otherwise print both
                divisors.extend((i,n//i))
        i = i + 1
    return divisors

def countTotalBits(num):

     # convert number into it's binary and
     # remove first two characters 0b.
     binary = bin(num)[2:]
     return(len(binary))
def isPrime(n) :

    # Corner cases
    if (n <= 1) :
        return False
    if (n <= 3) :
        return True

    # This is checked so that we can skip
    # middle five numbers in below loop
    if (n % 2 == 0 or n % 3 == 0) :
        return False

    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6

    return True
def ncr(n,r):
    if n<r:
        return 0
    numer=fact[n]
    # print(numer)
    denm=(fact[n-r]*fact[r])
    # print(denm)
    return numer*pow(denm,mod-2,mod)
""" def dfs(node,val):
    global tree,visited
    visited[node]=1
    ans[node]=val
    val^=1
    for i in tree[node]:
        if visited[i]==-1:
            dfs(i,val) """
""" fact=[1]*(1001)
c=1
mod=10**9+7
for i in range(1,1001):
    fact[i]=(fact[i-1]*i)%mod """
# print(fact)
for _ in range(vary(1)):
    a,b,n,m=vary(4)
    if a+b<(n+m):
        print('No')
        continue
    if n<abs(a-b) and m>min(a,b):
        print('No')
        continue
    print('Yes')


from collections import Counter
import string
import math
import sys
from fractions import Fraction
def array_int():
    return [int(i) for i in sys.stdin.readline().split()]
def vary(arrber_of_variables):
    if arrber_of_variables==1:
        return int(sys.stdin.readline())
    if arrber_of_variables>=2:
        return map(int,sys.stdin.readline().split())
def makedict(var):
    return dict(Counter(var))
# i am noob wanted to be better and trying hard for that
def printDivisors(n):
    divisors=[]
    # Note that this loop runs till square root
    i = 1
    while i <= math.sqrt(n):

        if (n % i == 0) :

            # If divisors are equal, print only one
            if (n//i == i) :
                divisors.append(i)
            else :
                # Otherwise print both
                divisors.extend((i,n//i))
        i = i + 1
    return divisors

def countTotalBits(num):

     # convert number into it's binary and
     # remove first two characters 0b.
     binary = bin(num)[2:]
     return(len(binary))
def isPrime(n) :

    # Corner cases
    if (n <= 1) :
        return False
    if (n <= 3) :
        return True

    # This is checked so that we can skip
    # middle five numbers in below loop
    if (n % 2 == 0 or n % 3 == 0) :
        return False

    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6

    return True
def ncr(n,r):
    if n<r:
        return 0
    numer=fact[n]
    # print(numer)
    denm=(fact[n-r]*fact[r])
    # print(denm)
    return numer*pow(denm,mod-2,mod)
""" def dfs(node,val):
    global tree,visited
    visited[node]=1
    ans[node]=val
    val^=1
    for i in tree[node]:
        if visited[i]==-1:
            dfs(i,val) """
""" fact=[1]*(1001)
c=1
mod=10**9+7
for i in range(1,1001):
    fact[i]=(fact[i-1]*i)%mod """
# print(fact)
for _ in range(vary(1)):
    a,b,n,m=vary(4)
    if a+b<(n+m):
        print('No')
        continue
    if m>min(a,b):
        print('No')
        continue
    print('Yes')


from collections import Counter
import string
import math
import sys
from fractions import Fraction
def array_int():
    return [int(i) for i in sys.stdin.readline().split()]
def vary(arrber_of_variables):
    if arrber_of_variables==1:
        return int(sys.stdin.readline())
    if arrber_of_variables>=2:
        return map(int,sys.stdin.readline().split())
def makedict(var):
    return dict(Counter(var))
# i am noob wanted to be better and trying hard for that
def printDivisors(n):
    divisors=[]
    # Note that this loop runs till square root
    i = 1
    while i <= math.sqrt(n):

        if (n % i == 0) :

            # If divisors are equal, print only one
            if (n//i == i) :
                divisors.append(i)
            else :
                # Otherwise print both
                divisors.extend((i,n//i))
        i = i + 1
    return divisors

def countTotalBits(num):

     # convert number into it's binary and
     # remove first two characters 0b.
     binary = bin(num)[2:]
     return(len(binary))
def isPrime(n) :

    # Corner cases
    if (n <= 1) :
        return False
    if (n <= 3) :
        return True

    # This is checked so that we can skip
    # middle five numbers in below loop
    if (n % 2 == 0 or n % 3 == 0) :
        return False

    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6

    return True
def ncr(n,r):
    if n<r:
        return 0
    numer=fact[n]
    # print(numer)
    denm=(fact[n-r]*fact[r])
    # print(denm)
    return numer*pow(denm,mod-2,mod)
""" def dfs(node,val):
    global tree,visited
    visited[node]=1
    ans[node]=val
    val^=1
    for i in tree[node]:
        if visited[i]==-1:
            dfs(i,val) """
""" fact=[1]*(1001)
c=1
mod=10**9+7
for i in range(1,1001):
    fact[i]=(fact[i-1]*i)%mod """
# print(fact)
for _ in range(vary(1)):
    a,b,n,m=vary(4)
    if a+b<(n+m):
        print('No')
        continue
    if n>=abs(a-b):
        if max(a,b)-n<m:
            print('No')
            continue
        else:
            print('Yes')
    else:
        if m>min(a,b):
            print('No')
        else:
            print('Yes')


for _ in range(int(input())):
    v,c,a,b = map(int,input().split())
    check=False
    a-=abs(v-c)
    v=min(v,c)
    c=v
    if a<=0:
         if b<=c:
             check=True
    else:
        if a>b and b+1<=v and a-1<=c:
            check=True
        elif v>=a and c>=b:
            check=True
    if check:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    v,c,a,b = map(int,input().split())
    check=False
    a-=abs(v-c)
    v=min(v,c)
    c=v
    if v>=a and c>=b:
        check=True
    if check:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    a,b,n,m = map(int,input().split())
    check=False
    if(((a>=m and a<=b and ((a+b-m)>=n)) or ((b>=m and a>b) and (a+b-m)>=n))):
        check=True
    if check:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    v,c,a,b = map(int,input().split())
    check=False
    a-=abs(v-c)
    v=min(v,c)
    c=v
    if (v>=b and c>=a) or (c>=b+1 and v>=a-1):
        check=True
    v-=a//2
    c-=(a+1)//2
    if v==c:
        v-=(b+1)//2
        c-=b//2
    else:
        v-=b
    if v>=0 and c>=0 and v+b<c:
        check=True
    if check:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    if max(c,d)<=min(a,b) and c+d<=a+b:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    if d<=min(a,b) and c+d<=a+b:
        print("YES")
    else:
        print("NO")


import sys
input = lambda:sys.stdin.readline().strip()
t = int(input())
while t:
    t-=1
    a,b,n,m = map(int,input().split())
    if (a+b)<(n+m):
        print("No")
    else:
        if a==0 and m!=0:
            print("No")
        elif b==0 and n!=0:
            print("No")
        else:
            print("Yes")


import sys
input = lambda:sys.stdin.readline().strip()
t = int(input())
while t:
    t-=1
    a,b,n,m = map(int,input().split())
    if (a+b)<(n+m):
        print("No")
    else:
        if a==0:
            if m==0:
                print("Yes")
            else:
                print("No")
        elif b==0:
            if n==0:
                print("Yes")
            else:
                print("No")
        else:
            if a==b:
                print("Yes")
            else:
                if (m-n)/abs(b-a)<=0:
                    print("No")
                else:
                    print("Yes")


import sys
input = lambda:sys.stdin.readline().strip()
t = int(input())
while t:
    t-=1
    a,b,n,m = map(int,input().split())
    if (a+b)>=(n+m) and m<=min(a,b):
        print("Yes")
    else:
        print("No")


import sys
input = lambda:sys.stdin.readline().strip()
t = int(input())
while t:
    t-=1
    a,b,n,m = map(int,input().split())
    if (a+b)<(n+m):
        print("No")
    else:
        if a==0:
            if m==0:
                print("Yes")
            else:
                print("No")
        elif b==0:
            if n==0:
                print("Yes")
            else:
                print("No")
        else:
            if a<=b:
                b = b-min(n,b-a+1)
                n-=b-a+1
                n = max(n,0)
                if n%2==0:
                    a-=(n//2)
                    b-=(n//2)
                else:
                    a-=(n//2)+1
                    b-=(n//2)
                if a<0:
                    print("No")
                else:
                    print("Yes")
            else:
                a = a-min(n,a-b+1)
                m-=a-b+1
                m = max(m,0)
                if m%2==0:
                    a-=(m//2)
                    b-=(m//2)
                else:
                    a-=(m//2)
                    b-=(m//2)+1
                if b<0:
                    print("No")
                else:
                    print("Yes")


import sys
input = lambda:sys.stdin.readline().strip()
t = int(input())
while t:
    t-=1
    a,b,n,m = map(int,input().split())
    if (a+b)<(n+m):
        print("No")
    else:
        if a==0:
            if m==0:
                print("Yes")
            else:
                print("No")
        elif b==0:
            if n==0:
                print("Yes")
            else:
                print("No")
        else:
            if a<=b:
                b = b-min(n,b-a+1)
                n-=min(n,b-a+1)
                n = max(n,0)
                if n%2==0:
                    a-=(n//2)
                    b-=(n//2)
                else:
                    a-=(n//2)+1
                    b-=(n//2)
                if a<0:
                    print("No")
                else:
                    print("Yes")
            else:
                a = a-min(m,a-b+1)
                m-=min(m,a-b+1)
                m = max(m,0)
                if m%2==0:
                    a-=(m//2)
                    b-=(m//2)
                else:
                    a-=(m//2)
                    b-=(m//2)+1
                if b<0:
                    print("No")
                else:
                    print("Yes")


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a>=m and b>=n:
        print("YES")
    else:
        print("NO")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n:
        print("NO")
        return
    if a>b:
        r=a-b

        a=a-min(n,r)
        n=n-r
        if n<0:
            n=0
        if a>=n and b>=m:
            print("YES")
        else:
            print("NO")

    else:
        r=b-a
        b=b-min(n,r)
        n=n-r
        if n<0:
            n=0
        if b>=n and a>=m:
            print("YES")
        else:
            print("NO")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n:
        print("NO")
        return
    if a>b:
        r=a-b-1

        a=a-min(n,r)
        n=n-r
        if n<0:
            n=0
        if a>=n and b>=m:
            print("YES")
        else:
            print("NO")

    else:
        r=b-a-1
        b=b-min(n,r)
        n=n-r
        if n<0:
            n=0
        if b>=n and a>=m:
            print("YES")
        else:
            print("NO")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n or min(a,b)<m:
        print("NO")
    else:
        print("YES")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n:
        print("NO")
        return
    if a>b:
        if b>=m and a>=n:
            print("YES")
        else:
            print("NO")
    else:
        if a>=m and b>=n:
            print("YES")
        else:
            print("NO")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n:
        print("NO")
        return
    if a>b:
        r=a-b
        m=m-r
        a=a-r
        if m<0:
            m=0
        if a>=n and b>=m:
            print("YES")
        else:
            print("NO")

    else:
        r=b-a
        n=n-r
        b=b-r
        if n<0:
            n=0
        if b>=m and a>=n:
            print("YES")
        else:
            print("NO")

t=int(input())
for i in range(0,t):
    main()


import math
from collections import deque
import sys

sys.setrecursionlimit(10**4)

def Divisors(n) :

	l=[]
	i = 2
	while i <= math.sqrt(n):

		if (n % i == 0) :

			if (n // i == i) :
				l.append(i)
			else :
				l.append(i)
				l.append(n//i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):

	l=[]

	prime = [True for i in range(n+1)]
	p = 2
	while (p * p <= n):

		if (prime[p] == True):

			for i in range(p * p, n+1, p):
				prime[i] = False
		p += 1

	for p in range(2, n+1):
		if prime[p]:
			l.append(p)

	return l

def primeFactors(n):

	l=[]

	while n % 2 == 0:
		l.append(2)
		n = n / 2

	for i in range(3,int(math.sqrt(n))+1,2):

		while n % i== 0:
			l.append(i)
			n = n / i

	if n > 2:
		l.append(n)

	return(l)

def Factors(n) :

	result = []

	for i in range(2,(int)(math.sqrt(n))+1) :

		if (n % i == 0) :

			if (i == (n/i)) :
				result.append(i)
			else :
			    result.append(i)
			    result.append(n//i)

	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):

	max_so_far = 0
	max_ending_here = 0
	size=len(a)

	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if (max_so_far < abs(max_ending_here)):
			max_so_far = max_ending_here

	return max_so_far

def longestsubarray(arr, n, k):
    current_count = 0

    # this will contain length of
    # longest subarray found
    max_count = 0

    for i in range(0, n, 1):
        if (arr[i] % k != 0):
            current_count += 1
        else:
            current_count = 0
        max_count = max(current_count,
                            max_count)

    return max_count

#print(SieveOfEratosthenes(100))
#print(Divisors(100))
#print(primeFactors(100))
#print(Factors(100))
#print(maxSubArraySum(a))

def main():

    #n=int(input())
    a,b,n,m=list(map(int,input().split()))
    if a+b < m+n:
        print("NO")
        return
    if a>b:
        r=a-b

        a=a-min(n,r)
        n=n-r
        if n<0:
            n=0
        if a>=m and b>=n:
            print("YES")
        else:
            print("NO")

    else:
        r=b-a
        b=b-min(n,r)
        n=n-r
        if n<0:
            n=0
        if b>=n and a>=m:
            print("YES")
        else:
            print("NO")

t=int(input())
for i in range(0,t):
    main()


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m >= min(a,b) or (a+b) < n+m):
        print("NO")
    else :
        print("YES")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m <= min(a,b) and (a+b) < n+m):
        print("NO")
    else :
        print("YES")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m < min(a,b) and (a+b) < n+m):
        print("NO")
    else :
        print("YES")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m < min(a,b) and a+b <= n+m):
        print("YES")
    else :
        print("NO")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m < min(a,b) and (n+m) <= (a+b)):
        print("Yes")
    else :
        print("No")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if( min(a,b) >= m and (a+b)>=(n+m)):
        print("Yes")
    else :
        print("No")


for _ in range(int(input())):
    a,b,n,m = list(map(int,input().split()))
    if(m < min(a,b) or (a+b) < n+m):
        print("NO")
    else :
        print("YES")


t = int(input())

while t:
	t-=1
	a, b, n, m = input().split()
	a = int(a); b = int(b); n = int(n); m = int(m)

	if min(a,b) >= m and max(a,b) >= n:
		print("YES")
	else:
		print("NO")


t = int(input())

while t:
	t-=1
	a, b, n, m = input().split()
	a = int(a); b = int(b); n = int(n); m = int(m)

	if min(a,b) >= m and max(a,b) >= n:
		print("YES")
	elif n == 0:
		print("NO")
	elif max(a,b)-n == min(a,b):
		print("YES")
	else:
		print("NO")


t = int(input())

while t:
	t-=1
	a, b, n, m = input().split()
	a = int(a); b = int(b); n = int(n); m = int(m)

	if min(a,b) >= m and a + b  >= n+m:
		print("YES")
	else:
		print("NO")


t = int(input())

while t:
	t-=1
	a, b, n, m = input().split()
	a = int(a); b = int(b); n = int(n); m = int(m)

	if min(a,b) >= m and max(a,b) >= n:
		print("YES")
	elif n == 0:
		print("NO")
	elif a+b >= n and a+b >= m+n:
		print("YES")
	else:
		print("NO")


t = int(input())

while t:
	t-=1
	a, b, n, m = input().split()
	a = int(a); b = int(b); n = int(n); m = int(m)

	if min(a,b) > m and a + b  >= n+m:
		print("YES")
	else:
		print("NO")


for _ in range(int(input())):
    a, b, n, m = map(int, input().split())
    if a+b < n+m:
        print("No")
    elif a==0 and n <= m:
        print("No")
    elif b==0 and n >= m:
        print("No")
    else:
        print("Yes")


for _ in range(int(input())):
    a, b, n, m = map(int, input().split())
    c = a+b
    d = n+m
    if c < d:
        print("No")
    elif a==0 and n <= m:
        print("No")
    elif b==0 and n >= m:
        print("No")
    else:
        print("Yes")


for _ in range(int(input())):
    a, b, n, m = map(int, input().split())
    if a+b < n+m:
        print("No")
    elif m > min(a,b):
        print("No")
    else:
        print("Yes")


for _ in range(int(input())):
    a, b, n, m = map(int, input().split())
    c = a+b
    d = n+m
    if c < d:
        print("No")
    elif a==0 and n < m:
        print("No")
    elif b==0 and n > m:
        print("No")
    else:
        print("Yes")


for _ in range(int(input())):
    a,b,n,m=map(int,input.split())
    if min(a,b)>=min(n,m) and n+m<=a+b:
        print("Yes")
    else:
        print("No")


for _ in range(int(input())):
    a,b,n,m=map(int,input().split())
    if min(a,b)>=min(n,m) and n+m<=a+b:
        print("Yes")
    else:
        print("No)


for _ in range(int(input())):
    a,b,n,m=map(int,input().split())
    if min(a,b)>=m and min(a,b)>=n and n+m<=a+b:
        print("Yes")
    else:
        print("No")


for _ in range(int(input())):
    a,b,n,m=map(int,input.split())
    if min(a,b)>=min(n,m) and n+m<=a+b:
        print("Yes")
    else:
        print("No)


for _ in range(int(input())):
    a,b,n,m=map(int,input().split())
    if min(a,b)>=min(n,m) and n+m<=a+b:
        print("Yes")
    else:
        print("No")


import sys; input = lambda: sys.stdin.readline()
for _ in range(int(input())):
    a, b, n, m = map(int, input().split())
    print('Yes' if n + m <= a + b and min(a, b) >= m else "No")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a>b:
        if a<n or b<m:
            print("No")
            p=p+1
    elif a<b and p==0:
        if a<m or b<n:
            print("No")
            p=p+1
    elif a+b<n+m:
        print("No")
        p=p+1
    if p==0:
        print("Yes")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a+b<n+m:
        print("No")
        p=p+1
    elif a>=b:
        if a<n or b<m:
            print("No")
            p=p+1
            continue;
    elif a<=b :
        if a<m or b<n:
            print("No")
            p=p+1
            continue;
    if p==0:
        print("Yes")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a>=b:
        if a>=n and b>=m:
            print("Yes")
            p=p+1
    elif a<=b and p==0:
        if a>=m and b>=n:
            print("Yes")
            p=p+1
    if p==0:
        print("No")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a>=b:
        if a>=n and b>=m:
            print("Yes")
            p=p+1
    elif a<=b:
        if a>=m and b>=n:
            print("Yes")
            p=p+1
    if p==0:
        print("No")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a+b<n+m:
        print("No")
        p=p+1
    elif a>=b:
        if b<m:
            print("No")
            p=p+1
            continue;
    elif a<=b :
        if a<m:
            print("No")
            p=p+1
            continue;
    if p==0:
        print("Yes")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a+b<n+m:
        print("No")
        p=p+1
        continue;
    elif a>=b:
        if a<n or b<m:
            print("No")
            p=p+1
            continue;
    elif a<=b and p==0:
        if a<m or b<n:
            print("No")
            p=p+1
            continue;
    if p==0:
        print("Yes")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a>=b:
        if a<n or b<m:
            print("No")
            p=p+1
            continue;
    elif a<=b :
        if a<m or b<n:
            print("No")
            p=p+1
            continue;
    if p==0:
        print("Yes")


t=int(input())
for i in range(t):
    a,b,n,m=list(map(int,input().split()))
    p=0
    if a>=b:
        if a<n or b<m:
            print("No")
            p=p+1
    elif a<=b and p==0:
        if a<m or b<n:
            print("No")
            p=p+1
    elif a+b<n+m:
        print("No")
        p=p+1
    if p==0:
        print("Yes")


import math
from decimal import *

for _ in range(int(input())):
    v, c, p1 ,p2 = map(int, input().split())
    dif = int(v-c)
    if(dif>0):
        if(p1 > p2):
            v1 = min(dif, p1)
            v-=v1
            p1-=v1
        elif(p1==p2):
            v-=dif
            p1-=dif
        else:
            v3 = min(dif, p1)
            v-= v3
            p1-= v3
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')
    else:
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')


import math
from decimal import *

for _ in range(int(input())):
    v, c, p1 ,p2 = map(int, input().split())
    dif = int(v-c)
    if(dif>0):
        if(p1 < p2):
            v1 = min(dif, p1)
            v-=v1
            p1-=v1
        elif(p1==p2):
            v-=dif
            p1-=dif
        else:
            v1 = min(dif, p2)
            v-=v1
            p2-=v1
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')
    else:
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')


import math
from decimal import *

for _ in range(int(input())):
    v, c, p1 ,p2 = map(int, input().split())
    dif = int(v-c)
    if(dif>0):
        if(p1 > p2):
            while(v-c > 0):
                v1 = min(dif, p1)
                v-=v1
                p1-=v1
        elif(p1==p2):
            v-=dif
            p1-=dif
        else:
            v-=p2
            p2= 0
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')
    else:
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')


import math
from decimal import *
import random

for _ in range(int(input())):
    a,b,n,m = map(int, input().split())
    if((n+m)<=(a+b) and m<=min(a,b)):
        print('YES')
    else:
        print('NO')


import math
from decimal import *

for _ in range(int(input())):
    v, c, p1 ,p2 = map(int, input().split())
    dif = int(v-c)
    if(dif>0):
        if(p1 > p2):
            v1 = min(dif, p1)
            v-=v1
            p1-=v1
        elif(p1==p2):
            v-=dif
            p1-=dif
        else:
            v-=p2
            p2= 0
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')
    else:
        v-=p2
        c-=p1
        if(v<0 or c<0):
            print('No')
        else:
            print('Yes')


from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))

def solve(a, b, n, m):
    return a + b >= n + m and m < min(a, b)

if __name__ == "__main__":
    for _ in tests():
        a, b, n, m = arr_in()
        bool_out(solve(a, b, n, m))


from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))

def solve(a, b, n, m):
    return a + b >= n + m and m < min(a, b):

if __name__ == "__main__":
    for _ in tests():
        a, b, n, m = arr_in()
        bool_out(solve(a, b, n, m))


from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))

def solve(a, b, n, m):
    if a + b >= n + m:
        return True
    if m < min(a, b):
        return True
    return False

if __name__ == "__main__":
    for _ in tests():
        a, b, n, m = arr_in()
        bool_out(solve(a, b, n, m))


from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))

def solve(a, b, n, m):
    if a + b < n + m:
        return False
    if m < min(a, b):
        return False
    return True

if __name__ == "__main__":
    for _ in tests():
        a, b, n, m = arr_in()
        bool_out(solve(a, b, n, m))


from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))

def solve(a, b, n, m):
    if min(a, b) < m:
        return False
    if a + b < n + m:
        return False
    return True

if __name__ == "__main__":
    for _ in tests():
        a, b, n, m = arr_in()
        bool_out(solve(a, b, n, m))


fun main() {
    repeat(readLine()!!.toInt()){
        val (a, b, n, m) = readLine()!!.split(" ").map { it.toLong() }
        var ans = "No"
        if (a+b>=m+n) {
            when {
                a>b -> if (m<=b) ans = "YES"
                a==b -> if (m<=a) ans = "YES"
                a<b -> if (m<=a) ans = "YES"
            }
        }
        println(ans)
    }
}


import kotlin.math.*

fun main(){
    val t = readLine()!!.toInt()
    for (test in 1..t){
        var (a, b, n, m) = readLine()!!.split(" ").map { it.toLong() }
        if(n + m <= a + b && min(a,b) >= m)
            println("Yes")
        else
            println("No")
    }
}


import java.lang.Math.*

private fun readLn() = readLine()!! // string line
private fun readStrings() = readLn().split(" ") // list of strings
private fun readLong() = readLn().toLong()
private fun readLongs() = readStrings().map { it.toLong() } // list of ints
private fun readInt() = readLn().toInt() // single int
private fun readInts() = readStrings().map { it.toInt() } // list of ints

//var n = 0
//var ar = listOf<Int>()

fun main() {
    val t = readInt()

    for (cases in 0 until t) {
        solve()
    }
}

fun solve() {
    var (a,b,n,m) = readLongs()

    if (a + b < n + m) {
        println("No")
        return
    }

    println(if (m > min(a, b)) "No" else "Yes")
}


import java.io.PrintWriter
import java.util.*
import kotlin.math.max
import kotlin.math.min

fun main() {

    fun PrintWriter.solve() {
        var (a, b, n, m) = List(4) { nextLong() }
        if (n + m > a + b) println("No")
        else {

                if (min(a,b) >= m && max(a,b) >= n)println("Yes")
                else println("No")

        }

    }
    repeat(nextInt()) {
        writer.solve()
    }
    writer.flush()

}

private val reader = System.`in`.bufferedReader()
private val writer = PrintWriter(System.out, false)

private var tokenizer: StringTokenizer = StringTokenizer("")

private fun next(): String {
    while (tokenizer.hasMoreTokens().not()) tokenizer = StringTokenizer(reader.readLine())
    return tokenizer.nextToken()
}

private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextLine() = reader.readLine()


import java.io.PrintWriter
import java.util.*
import kotlin.math.max
import kotlin.math.min

fun main() {
    fun PrintWriter.solve() {
        var (a, b, n, m) = List(4) { nextLong() }
        if (n + m > a + b) println("No")
        else {
                if (min(a,b) >= m && max(a,b) +(min(a,b) - m) >= n)println("Yes")
                else println("No")

        }

    }
    repeat(nextInt()) {
        writer.solve()
    }
    writer.flush()

}

private val reader = System.`in`.bufferedReader()
private val writer = PrintWriter(System.out, false)

private var tokenizer: StringTokenizer = StringTokenizer("")

private fun next(): String {
    while (tokenizer.hasMoreTokens().not()) tokenizer = StringTokenizer(reader.readLine())
    return tokenizer.nextToken()
}

private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextLine() = reader.readLine()


import java.io.PrintWriter
import java.util.StringTokenizer

fun main() {

    fun PrintWriter.solve() {

    }

    writer.solve()
    writer.flush()

}

private val reader = System.`in`.bufferedReader()
private val writer = PrintWriter(System.out, false)

private var tokenizer: StringTokenizer = StringTokenizer("")

private fun next(): String {
    while (tokenizer.hasMoreTokens().not()) tokenizer = StringTokenizer(reader.readLine())
    return tokenizer.nextToken()
}

private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextLine() = reader.readLine()


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    for (i in 0 until ni()) {
      out.println(if (solve2()) "Yes" else "No")
    }
  }

  fun solve2(): Boolean {
    val A = nl()
    val B = nl()
    val N = nl()
    val M = nl()
    if (A + B < N + M) return false
    val mn = min(A, B)
    return mn >= M
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<LongArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }
  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


import java.util.*
import kotlin.math.max

private val scanner = Scanner(System.`in`)

fun res(success: Boolean) {
    if (success) {
        println("Yes")
    } else {
        println("No")
    }
}

fun exec(a: Long, b: Long, n: Long, m: Long) {
    if (a + b < n + m) {
        return res(false)
    }

    if (m <= a && m <= b) {
        return res(true)
    } else if (n >= listOf(a, b, m).max() ?: 0) {
        return res(true)
    } else {
        return res(false)
    }
}

fun main() {
    scanner.apply {
        val t = nextInt()
        for (TEST in 0 until t) {
            val a = nextLong()
            val b = nextLong()
            val n = nextLong()
            val m = nextLong()

            exec(a, b, n, m)
        }
    }
}


@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")
//@file:OptIn(ExperimentalStdlibApi::class)

import java.io.PrintWriter
import kotlin.math.*
import kotlin.random.Random
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() { _writer.solve(); _writer.flush() }

fun PrintWriter.solve() {
    //val startTime = System.nanoTime()

    val numCases = readInt()
    case@ for(case in 1..numCases) {
        //print("Case #$case: ")

        var a = readLong()
        var b = readLong()
        var n = readLong()
        var m = readLong()

        if(a < b) a = b.also { b = a }
        min(a-b, n).let { a -= it; n -= it }
        if(a == b) {
            minOf(a, n, m).let {
                a -= it
                b -= it
                n -= it
                m -= it
            }
        }

        val ans = if(n > 0) a + b >= n else min(a, b) >= m

        println(if(ans) "Yes" else "No")
    }

//    iprintln("Time: ${(System.nanoTime() - startTime) / 1000000} ms")
}

val Int.tr get() = toLong() * plus(1) / 2

/** IO */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

const val _BUFFER_SIZE = 1 shl 16
@JvmField val _buffer = ByteArray(_BUFFER_SIZE)
@JvmField var _bufferPt = 0
@JvmField var _bytesRead = 0

tailrec fun readChar(): Char {
    if(_bufferPt == _bytesRead) {
        _bufferPt = 0
        _bytesRead = INPUT.read(_buffer, 0, _BUFFER_SIZE)
    }
    return if(_bytesRead < 0) Char.MIN_VALUE
    else {
        val c = _buffer[_bufferPt++].toChar()
        if (c == '\r') readChar()
        else c
    }
}

fun readLine(): String? {
    var c = readChar()
    return if(c == Char.MIN_VALUE) null
    else buildString {
        while(c != '\n' && c != Char.MIN_VALUE) {
            append(c)
            c = readChar()
        }
    }
}
fun readLn() = readLine()!!

fun read() = buildString {
    var c = readChar()
    while(c <= ' ') {
        if(c == Char.MIN_VALUE) return@buildString
        c = readChar()
    }
    do {
        append(c)
        c = readChar()
    } while(c > ' ')
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() { iprintln(max(1, 2)) }

/** additional commons */
inline fun <T> Iterable<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
inline fun <T> Sequence<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
inline fun <T> Array<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
fun IntArray.sumLong() = fold(0L, Long::plus)


import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs

fun main(args: Array<String>) {
    c()
}

fun divisor(n: Int): Int {
    var i = 2
    while (i * i <= n) {
        if (n % i == 0) return i
        i++
    }
    return n
}

fun a() {
    repeat(readInt()) {
        val a = readInt()
        println((a + 1) / 2);
    }
}

fun pow(a: Int, b: Int): Long {
    var res = 1L
    repeat(b) { res *= a }
    return res
}

fun b() {
    repeat(readInt()) {
        val (n, r) = readLongs()

        val ans = if (n > r) {
            r * (r + 1) / 2
        } else {
            ((n - 1) * n / 2) + 1
        }

        println(ans)
    }
}

fun c() {
    repeat(readInt()) {
        val (a, b, n, m) = readLongs()

        if (a + b < n + m) {
            println("No")
            return@repeat
        }
        if (minOf(a, b) < m) {
            println("No")
            return@repeat
        }
        println("Yes")
    }
}

fun df(a: IntArray): Pair<Triple<Long, Int, Int>, Triple<Long, Int, Int>> {

    var dif = 0L
    var lastIndex = 0
    var maxDif = 0L
    var maxIndex = 0
    var maxLength = 0
    for (i in 0 until a.size - 1 step 2) {
        dif += a[i + 1] - a[i]
        if (dif <= 0) {
            dif = 0
            lastIndex = i + 2
            continue
        }
        if (dif > maxDif) {
            maxDif = dif
            maxIndex = lastIndex
            maxLength = i + 2 - lastIndex
        }
    }

    var dif1 = 0L
    var lastIndex1 = 1
    var maxDif1 = 0L
    var maxIndex1 = 0
    var maxLength1 = 0
    for (i in 1 until a.size - 1 step 2) {
        dif1 += a[i + 1] - a[i]
        if (dif1 >= 0) {
            dif1 = 0
            lastIndex1 = i + 2
            continue
        }
        if (dif1 < maxDif1) {
            maxDif1 = dif1
            maxIndex1 = lastIndex1
            maxLength1 = i + 2 - lastIndex1
        }
    }

    return Pair(Triple(maxDif, maxIndex, maxLength), Triple(-maxDif1, maxIndex1, maxLength1))
}

fun d() {
    repeat(readInt()) {
        val n = readInt()
        val a = readInts().toMutableList()

        val (even, odd) = df(a.toIntArray())

        val max = arrayOf(even, odd).maxBy { it.first }!!

//        println(even)
//        println(odd)
//        println(max)
//        println()

        a.subList(max.second, max.second + max.third).reverse()

        var ans = 0L
        for (i in 0 until a.size step 2) ans += a[i]

        println(ans)
    }
}

fun f() {
    val (n, m, q) = readInts()
    val a = Array(n) { IntArray(m) }

    val rows = LongArray(n)
    val columns = LongArray(m)

    for (i in 0 until n) {
        a[i] = readInts().toIntArray()

        for (j in 0 until m) {
            rows[i] = rows[i] + a[i][j]
            columns[j] = columns[j] + a[i][j]
        }
    }

    val rowsP = LongArray(n)
    val rowsS = LongArray(n)

    val rowsPM = LongArray(n)
    val rowsSM = LongArray(n)

    val columnsP = LongArray(m)
    val columnsS = LongArray(m)

    val columnsPM = LongArray(m)
    val columnsSM = LongArray(m)

    for (i in 0 until q + 1) {
        if (i != 0) {
            val (x, y, z) = readInts()
            val diff = z - a[x - 1][y - 1]
            rows[x - 1] = rows[x - 1] + diff
            columns[y - 1] = columns[y - 1] + diff
            a[x - 1][y - 1] = z
        }

        rowsP[0] = rows[0]
        for (j in 1 until n) {
            rowsP[j] = rowsP[j - 1] + rows[j]
            rowsPM[j] = rowsP[j - 1] + rowsPM[j - 1]
        }

        rowsS[n - 1] = rows[n - 1]
        for (j in n - 2 downTo 0) {
            rowsS[j] = rowsS[j + 1] + rows[j]
            rowsSM[j] = rowsS[j + 1] + rowsSM[j + 1]
        }

        columnsP[0] = columns[0]
        for (j in 1 until m) {
            columnsP[j] = columnsP[j - 1] + columns[j]
            columnsPM[j] = columnsP[j - 1] + columnsPM[j - 1]
        }

        columnsS[m - 1] = columns[m - 1]
        for (j in m - 2 downTo 0) {
            columnsS[j] = columnsS[j + 1] + columns[j]
            columnsSM[j] = columnsS[j + 1] + columnsSM[j + 1]
        }

        var minRow = minOf(rowsSM[0], rowsPM[n - 1])
        for (j in 1 until n - 1) {
            minRow = minOf(minRow, rowsSM[j] + rowsPM[j])
        }

        var minColumn = minOf(columnsSM[0], columnsPM[m - 1])
        for (j in 1 until m - 1) {
            minColumn = minOf(minColumn, columnsSM[j] + columnsPM[j])
        }

        print("${minRow + minColumn}\n")
    }
}

private inline fun sqr(x: Int) = 1L * x * x

val t = IntArray(2_200_000)

fun build(a: IntArray, v: Int, tl: Int, tr: Int) {
    if (tl == tr) {
        t[v] = a[tl]
    } else {
        val tm = (tl + tr) / 2
        build(a, v * 2, tl, tm)
        build(a, v * 2 + 1, tm + 1, tr)
        t[v] = t[v * 2] + t[v * 2 + 1]
    }

//    println("$v [$tl, $tr] = ${t[v]}")
}

fun update(v: Int, tl: Int, tr: Int, pos: Int): Int {
    if (tl == tr) {
        t[v]++
        return t[v]
    } else {
        val tm = (tl + tr) / 2
        val res = if (pos <= tm) {
            update(v * 2, tl, tm, pos)
        } else {
            update(v * 2 + 1, tm + 1, tr, pos)
        }
        t[v] = t[v * 2] + t[v * 2 + 1]
        return res
    }
}

fun delete(v: Int, tl: Int, tr: Int, pos: Int): Int {
//    println("$v [$tl, $tr] = ${t[v]}, pos = $pos")
    if (tl == tr) {
        t[v]--
        return tl
    } else {
        val tm = (tl + tr) / 2
        val res = if (pos <= t[v * 2]) {
            delete(v * 2, tl, tm, pos)
        } else {
            delete(v * 2 + 1, tm + 1, tr, pos - t[v * 2])
        }
        t[v] = t[v * 2] + t[v * 2 + 1]
        return res
    }
}

fun e() {
    val N = 1_00_000
    val f = IntArray(N)
    for (i in 0 until N) {
        f[i] = f[i / 10] + i % 10
    }

    val max = f.max()!!

//    println(max)

    repeat(readInt()) {
        val (n, k) = readInts()

        if (max * (k + 1) >= n) {
            var sum = 0
            for (i in 0 until k + 1) {
                sum += f[i]
            }

            if (n == sum) {
                println(0)
                return@repeat
            }

            for (i in 1 until N - k) {
                sum -= f[i - 1]
                sum += f[i + k]

                if (n == sum) {
                    println(i)
                    return@repeat
                }
            }
        }

        val res = StringBuilder()
        res.append('9')
        var sum = (9 - k..9).sum()

        println("$res $sum")

        while (sum < n) {
            res.append('9')
            sum += 9 * (k + 1)

            println("$res $sum")

            if (sum == n) {
                res[res.length - 1] = '9' - k
                println(res)
                return@repeat
            }
            if (sum > n) {
                sum -= 9 * (k + 1)
                for (i in 1 until 9) {
                    if (sum + i * (k + 1) == n) {
                        res[0] = '0' + i
                        res[res.length - 1] = '9' - k
                        println(res)
                        return@repeat
                    }
                }
                break
            }
        }

        println(-1)
    }
}

internal class FastScanner {
    var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))
    var st: StringTokenizer? = null

    operator fun next(): String {
        while (st == null || !st!!.hasMoreElements()) {
            try {
                st = StringTokenizer(br.readLine())
            } catch (e: IOException) {
                e.printStackTrace()
            }
        }
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return next().toInt()
    }
}

fun Int.isEven(): Boolean = this % 2 == 0
fun Int.isOdd(): Boolean = this % 2 == 1

public operator fun <T> List<T>.component6(): T {
    return get(5)
}

fun allPrimesUpTo(n: Int): List<Int> {
    val isPrime = BooleanArray(n + 1) { true }
    val primes = mutableListOf<Int>()

    isPrime[0] = false
    isPrime[1] = false
    for (i in 2 until n + 1) {
        if (isPrime[i]) {
            primes.add(i)

            if (i.toLong() * i > n)
                continue

            for (j in i * i until n + 1 step i) {
                isPrime[j] = false
            }
        }
    }

    return primes
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val t = sc.nextInt()
    for (_i in 0 until t) {
        var a = sc.nextLong()
        var b = sc.nextLong()
        var n = sc.nextLong()
        var m = sc.nextLong()
        println(if (n + m <= a + b && m <= minOf(a, b)) "Yes" else "No")
    }
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val t = sc.nextInt()
    for (_i in 0 until t) {
        var a = sc.nextLong()
        var b = sc.nextLong()
        var n = sc.nextLong()
        var m = sc.nextLong()
        if (a <= b) {
            a -= m
            m = 0
        } else {
            b -= m
            m = 0
        }
        var ok = true
        if (a < 0 || b < 0) ok = false
        else if (a + b < n) ok = false
        println(if (ok) "Yes" else "No")
    }
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


import java.util.*
import kotlin.math.max

fun main() {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    scanner.nextLine()
    val list = mutableListOf<String>()
    for (i in 0 until n) {
        val a = scanner.nextLine()
        list.add(a)
    }
    list.forEach {
        val s = it.split(" ")
        var vanilla = s[0].toLong()
        var choco = s[1].toLong()
        var firstGroup = s[2].toLong()
        var secondGroup = s[3].toLong()
        if (vanilla + choco < firstGroup + secondGroup || Math.min(choco, vanilla) < secondGroup) {
            println("No")
        } else {
            println("Yes")
//            while (vanilla > 0 || choco > 0 && secondGroup <= Math.min(choco,vanilla)) {
////                if (secondGroup > 0 && vanilla > choco && choco > 0) {
////                    val minus = Math.min(choco, secondGroup)
////                    secondGroup -= minus
////                    choco -= minus
////                } else if (secondGroup > 0 && vanilla <= choco && vanilla > 0) {
////                    val minus = Math.min(vanilla, secondGroup)
////                    secondGroup -= minus
////                    vanilla -= minus
////                } else if (firstGroup > 0 && vanilla > choco) {
////                    val minus = Math.min(vanilla, firstGroup)
////                    firstGroup -= minus
////                    vanilla -= minus
////                } else if (firstGroup > 0 && vanilla <= choco) {
////                    val minus = Math.min(choco, firstGroup)
////                    firstGroup -= minus
////                    choco -= minus
////                }
////
////                if(firstGroup <= 0 && secondGroup <= 0){
////                    break
////                }
////            }
////            if (firstGroup > 0 || secondGroup > 0) {
////                println("No")
////            } else {
////                println("Yes")
////            }
        }
    }
}


import java.util.*
import kotlin.math.max

fun main() {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    scanner.nextLine()
    val list = mutableListOf<String>()
    for (i in 0 until n) {
        val a = scanner.nextLine()
        list.add(a)
    }
    list.forEach {
        val s = it.split(" ")
        var vanilla = s[0].toLong()
        var choco = s[1].toLong()
        var firstGroup = s[2].toLong()
        var secondGroup = s[3].toLong()
        if (vanilla + choco < firstGroup + secondGroup) {
            println("No")
        } else {
            while (vanilla > 0 || choco > 0 && secondGroup <= Math.min(choco,vanilla)) {
                if (secondGroup > 0 && vanilla > choco && choco > 0) {
                    val minus = Math.min(choco, secondGroup)
                    secondGroup -= minus
                    choco -= minus
                } else if (secondGroup > 0 && vanilla <= choco && vanilla > 0) {
                    val minus = Math.min(vanilla, secondGroup)
                    secondGroup -= minus
                    vanilla -= minus
                } else if (firstGroup > 0 && vanilla > choco) {
                    val minus = Math.min(vanilla, firstGroup)
                    firstGroup -= minus
                    vanilla -= minus
                } else if (firstGroup > 0 && vanilla <= choco) {
                    val minus = Math.min(choco, firstGroup)
                    firstGroup -= minus
                    choco -= minus
                }

                if(firstGroup <= 0 && secondGroup <= 0){
                    break
                }
            }
            if (firstGroup > 0 || secondGroup > 0) {
                println("No")
            } else {
                println("Yes")
            }
        }
    }
}


import java.io.BufferedReader
import java.io.InputStreamReader
import kotlin.math.min

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    for (c in 1..jin.readLine().toInt()) {
        val (a, b, n, m) = jin.readLine().split(" ").map { it.toLong() }
        println(if (m <= min(a, b) && n + m <= a + b) "yEs" else "nO")
    }
}


import java.io.*
import java.util.*
import kotlin.math.*

fun main(){
	val f = BufferedReader(InputStreamReader(System.`in`))

	for(q in 1..f.readLine().toInt()){
		val (x,y,n,m) = f.readLine().split(" ").map{it.toLong()}

		var a = min(x,y)
		var b = max(x,y)
		if(a < m){
			println("No")
		} else {
			a-=m
			if(a+b >= n){
				println("Yes")
			} else {
				println("No")
			}
		}
	}
}


import java.io.BufferedReader
import kotlin.math.min

fun main() {
    val br = System.`in`.bufferedReader()
    val sb = StringBuilder()
    val t = br.readInt()
    repeat(t) {
        val a = br.readLong()
        val b = br.readLong()
        val n = br.readLong()
        val m = br.readLong()
        if(n + m > a + b){
          sb.append("No\n")
        } else if(m > min(a, b)){
            sb.append("No\n")
        } else {
            sb.append("Yes\n")
        }
    }
    print(sb)
}

private const val SPACE_INT = ' '.toInt()
private const val ZERO_INT = '0'.toInt()
private const val NL_INT = '\n'.toInt()

private fun BufferedReader.readInt(): Int {
    var ret = read()
    while (ret <= SPACE_INT) {
        ret = read()
    }
    val neg = ret == '-'.toInt()
    if (neg) {
        ret = read()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }

    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}

@Suppress("DuplicatedCode")
private fun BufferedReader.readLong(): Long {
    var ret = read().toLong()
    while (ret <= SPACE_INT) {
        ret = read().toLong()
    }
    val neg = ret == '-'.toLong()
    if (neg) {
        ret = read().toLong()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }
    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}


import java.lang.Long.min

fun main() {
    val t= readInt()
    repeat(t){
        val numbers = readLongs()
        val a = numbers[0]
        val b = numbers[1]
        val n = numbers[2]
        val m = numbers[3]
        if(n+m>a+b){
            println("No")
        }
        else{
           if(min(a,b)<m){
               println("No")
           }
            else{
               println("Yes")
           }
        }
    }
}

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }
private fun readLongs() = readStrings().map { it.toLong() }


//package cf1371

import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.StringTokenizer

class C {
    private val input: BufferedReader = BufferedReader(InputStreamReader(System.`in`))
    private val output: PrintWriter = PrintWriter(System.out)

    var st: StringTokenizer? = null

    private fun closeAfter() {
        input.close()
        output.close()
    }

    private fun next(): String {
        if (st == null || !st!!.hasMoreElements()) {
            st = StringTokenizer(input.readLine())
        }

        return st!!.nextToken()
    }

    private fun nextInt(): Int {
        return next().toInt()
    }

    private fun nextLong(): Long {
        return next().toLong()
    }

    private fun nextDouble(): Double {
        return next().toDouble()
    }

    fun solve() {
        innerSolve()
        closeAfter()
    }

    private fun innerSolve() {
        val tt = nextInt()
        for (t in 0 until tt) {
            var a = nextLong()
            var b = nextLong()
            var n = nextLong()
            var m = nextLong()

            if (a != b) {
                val diff = Math.min(if (a > b) a - b else b - a, n)
                n -= diff
                if (a > b) {
                    a -= diff
                } else {
                    b -= diff
                }
            }

            if (a == b) {
                val diff = Math.min(a, Math.min(n, m))
                a -= diff
                b -= diff
                n -= diff
                m -= diff
            }

            if (Math.min(a, b) >= m) {
                if (a > b) {
                    b -= m
                } else {
                    a -= m
                }

                if (a + b >= n) {
                    output.println("Yes")
                } else {
                    output.println("No")
                }

            } else {
                output.println("No")
            }
        }
    }
}

fun main(args: Array<String>) {
    C().solve()
}


import java.lang.Integer.max
import java.lang.Integer.min
import java.lang.Math.*
import java.math.BigInteger
import java.util.*

fun main(args: Array<String>): Unit = with(Scanner(System.`in`)) {
    repeat(nextInt()) {
        val a = nextLong()
        val b = nextLong()
        val maxx = nextLong()
        val minn = nextLong()
        fun res():Boolean {
            var min = min(a, b)
            var max = max(a, b)
            min -= minn
            if (min < 0) {
                return false
            }
            max -= maxx + min
            if (max < 0) {
                return false
            }
            return true
        }

        if (res()) {
            println("Yes")
        } else {
            println("No")
        }
    }

}


import java.lang.Integer.max
import java.lang.Integer.min
import java.lang.Math.*
import java.math.BigInteger
import java.util.*

fun main(args: Array<String>): Unit = with(Scanner(System.`in`)) {
    repeat(nextInt()) {
        val a = nextLong()
        val b = nextLong()
        val maxx = nextLong()
        val minn = nextLong()
        fun res():Boolean {
            var min = min(a, b)
            var max = max(a, b)
            min -= minn
            if (min < 0) {
                return false
            }
            max -= maxx
            max += min
            if (max < 0) {
                return false
            }
            return true
        }

        if (res()) {
            println("Yes")
        } else {
            println("No")
        }
    }

}


import java.lang.Integer.max
import java.lang.Integer.min
import java.lang.Math.*
import java.math.BigInteger
import java.util.*

fun main(args: Array<String>): Unit = with(Scanner(System.`in`)) {
    repeat(nextInt()) {
        val a = nextLong()
        val b = nextLong()
        val maxx = nextLong()
        val minn = nextLong()
        fun res():Boolean {
            if (a + b < maxx + minn) {
                return false
            }

            if (a > max(maxx, minn) && b > max(maxx, minn)) {
                return true
            }
            return Math.min(a,b) >= minn && Math.max(a,b) >= maxx
        }

        if (res()) {
            println("Yes")
        } else {
            println("No")
        }
    }

}


import java.lang.Integer.max
import java.lang.Integer.min
import java.lang.Math.*
import java.math.BigInteger
import java.util.*

fun main(args: Array<String>): Unit = with(Scanner(System.`in`)) {
    repeat(nextInt()) {
        val a = nextLong()
        val b = nextLong()
        val maxx = nextLong()
        val minn = nextLong()
        fun res():Boolean {
            var min = min(a, b)
            var max = max(a, b)
            min -= minn
            if (min < 0) {
                return false
            }
            max -= maxx
            if (max < min) {
                return false
            }
            return true
        }

        if (res()) {
            println("Yes")
        } else {
            println("No")
        }
    }

}