A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-th pigment.A picture is considered beautiful if each cell has at least $$$3$$$ toroidal neighbors with the same color as itself.Two cells are considered toroidal neighbors if they toroidally share an edge. In other words, for some integers $$$1 \leq x_1,x_2 \leq n$$$ and $$$1 \leq y_1,y_2 \leq m$$$, the cell in the $$$x_1$$$-th row and $$$y_1$$$-th column is a toroidal neighbor of the cell in the $$$x_2$$$-th row and $$$y_2$$$-th column if one of following two conditions holds:  $$$x_1-x_2 \equiv \pm1 \pmod{n}$$$ and $$$y_1=y_2$$$, or  $$$y_1-y_2 \equiv \pm1 \pmod{m}$$$ and $$$x_1=x_2$$$. Notice that each cell has exactly $$$4$$$ toroidal neighbors. For example, if $$$n=3$$$ and $$$m=4$$$, the toroidal neighbors of the cell $$$(1, 2)$$$ (the cell on the first row and second column) are: $$$(3, 2)$$$, $$$(2, 2)$$$, $$$(1, 3)$$$, $$$(1, 1)$$$. They are shown in gray on the image below:  The gray cells show toroidal neighbors of $$$(1, 2)$$$. Is it possible to color all cells with the pigments provided and create a beautiful picture?

Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the number of rows and columns of the picture and the number of pigments. The next line contains $$$k$$$ integers $$$a_1,a_2,\dots, a_k$$$ ($$$1 \leq a_i \leq 10^9$$$) — $$$a_i$$$ is the maximum number of cells that can be colored with the $$$i$$$-th pigment. It is guaranteed that the sum of $$$k$$$ over all test cases does not exceed $$$10^5$$$.

For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).

NoteIn the first test case, one possible solution is as follows:  In the third test case, we can color all cells with pigment $$$1$$$.

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

func readInt() int {
	var value int
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInt64() int64 {
	var value int64
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readString() string {
	var value string
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	return a
}

func readInts64(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = readInt64()
	}
	return a
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(bufferedStdout, format, value...)
}

func printErr(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(os.Stderr, format, value...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func canFill(n, m int64, a []int64) bool {
	size := n * m
	sum := int64(0)
	using := make([]bool, len(a))
	for i := 0; i < len(a); i++ {
		if n > 1 && a[i]/m > 1 {
			sum += 2 * m
			n -= 2
			using[i] = true
		}
	}
	for i := 0; i < len(a); i++ {
		if using[i] {
			sum += (a[i] - 2*m) / m * m
		}
	}
	return sum >= size
}

func solve() {
	var n, m, k = readInt64(), readInt64(), readInt64()
	b := readInts(int(k))
	sort.Ints(b)
	a := make([]int64, k)
	for i := 0; i < int(k); i++ {
		a[len(b)-1-i] = int64(b[i])
	}
	if canFill(n, m, a) || canFill(m, n, a) {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

func main() {
	var t = 1
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

func A5() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		var n, m, k int
		Fscan(in, &n, &m, &k)
		a := make([]int, k)
		for i := 0; i < k; i++ {
			Fscan(in, &a[i])
		}

		var s func(r, c int) bool
		s = func(r, c int) bool {
			var cur int64
			var f, f2 int
			for i := 0; i < k; i++ {
				var t = a[i] / r
				if t >= 3 {
					f2 = 1
				}
				if t >= 3 && (t&1) == 1 {
					cur += int64(t - 1)
					f++
				} else if t >= 2 {
					cur += int64(t)
				}
			}
			if int64(c) <= cur {
				if ((cur - int64(c)) & 1) == 0 {
					return true
				} else {
					if f2 > 0 {
						return true
					} else {
						return false
					}
				}
			} else {
				var need = int64(c) - cur
				if need > int64(f) {
					return false
				} else {
					return true
				}
			}
		}
		if s(m, n) || s(n, m) {
			Fprintln(out, "Yes")
		} else {
			Fprintln(out, "No")
		}
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A5() }

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n, m, k int
		fmt.Fscan(in, &n, &m, &k)

		aa := make([]int, k)
		for i := 0; i < k; i++ {
			fmt.Fscan(in, &aa[i])
		}
		sort.Slice(aa, func(i, j int) bool { return aa[i] > aa[j] })

		solve := func(n, m int) bool {
			g := m
			if g%2 != 0 && aa[0]/n < 3 {
				return false
			}

			for _, v := range aa {
				if g <= 0 {
					break
				}
				d := v / n
				if d < 2 {
					return false
				}
				g -= d
			}
			return g <= 0
		}
		if solve(n, m) || solve(m, n) {
			fmt.Fprintln(out, "Yes")
		} else {
			fmt.Fprintln(out, "No")
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n, m, k int
		fmt.Fscan(in, &n, &m, &k)

		aa := make([]int, k)
		for i := 0; i < k; i++ {
			fmt.Fscan(in, &aa[i])
		}
		sort.Slice(aa, func(i, j int) bool { return aa[i] > aa[j] })

		solve := func(n, m int) bool {
			g := m
			var f bool
			for _, v := range aa {
				if g <= 0 {
					break
				}
				d := v / n
				if d < 2 && g > 0 {
					return false
				} else if d > 2 {
					f = true
				}
				g -= d
			}
			return g == 0 || g < -1 || (g == -1 && f)
		}
		if solve(n, m) || solve(m, n) {
			fmt.Fprintln(out, "Yes")
		} else {
			fmt.Fprintln(out, "No")
		}
	}
}

package main

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

var wg sync.WaitGroup
type Int uint64
var dnl = "%d\n"
var snl = "%s\n"
var dddnl = "%d %d %d\n"

func main() {
	defer writer.Flush()

	dPtr := &dnl
	sPtr := &snl
	dddPtr := &dddnl

	var (
		t, n, m, k Int
		astr 	   string
	)

	scanf(*dPtr, &t)

	for ; t > 0; t-- {
		scanf(*dddPtr, &n, &m, &k)
		scanln(&astr)

		a := StrToIntSlice(astr)

		boolCh := make(chan bool, 2)
		wg.Add(2)

		go maybePossible(n, m, &a, boolCh, &wg)
		go maybePossible(m, n, &a, boolCh, &wg)

		wg.Wait()
		printf(*sPtr, yesNoMap(<-boolCh || <-boolCh))
	}
}

func maybePossible(x, y Int, colorArr *[]Int, outCh chan bool, waitG *sync.WaitGroup) {
	var c, tot Int
	var oddOkay bool
	for i := range *colorArr {
		c = (*colorArr)[i] / x
		if c >= 2 {
			tot += c
		}
		if c >= 3 && !oddOkay {
			oddOkay = true
		}
	}
	outCh <- tot >= y && (y % 2==0 || oddOkay)
	waitG.Done()
}

func SplitString(str string) []string {
	return strings.Fields(str)
}

func Atoi(str string) Int {
	out, _ := strconv.ParseInt(str, 10, 64)
	return Int(out)
}

func StrToIntSlice(str string) []Int {
	sarr := SplitString(str)
	iarr := make([]Int, len(sarr))
	for i := range sarr {
		iarr[i] = Atoi(sarr[i])
	}
	return iarr
}

func yesNoMap(tf bool) string {
	return map[bool]string{false: "NO", true: "YES"}[tf]
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanln(s *string) { *s, _ = reader.ReadString('\n') }

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var s string
	s, err := reader.ReadString('\n')
	if err != nil {
		panic(err)
	}

	tests, err := strconv.Atoi(s[:len(s)-2])
	if err != nil {
		panic(err)
	}

	var n, m, k int
	for i := 0; i < tests; i++ {
		s, err = reader.ReadString(' ')
		if err != nil {
			panic(err)
		}

		n, err = strconv.Atoi(s[:len(s)-1])
		if err != nil {
			panic(err)
		}

		s, err = reader.ReadString(' ')
		if err != nil {
			panic(err)
		}

		m, err = strconv.Atoi(s[:len(s)-1])
		if err != nil {
			panic(err)
		}

		s, err = reader.ReadString('\n')
		if err != nil {
			panic(err)
		}

		k, err = strconv.Atoi(s[:len(s)-2])
		if err != nil {
			panic(err)
		}

		a := make([]int, k)
		for i := 0; i < k-1; i++ {
			s, err = reader.ReadString(' ')
			if err != nil {
				panic(err)
			}

			a[i], err = strconv.Atoi(s[:len(s)-1])
			if err != nil {
				panic(err)
			}
		}

		s, err = reader.ReadString('\n')
		if err != nil {
			panic(err)
		}

		a[k-1], err = strconv.Atoi(s[:len(s)-2])
		if err != nil {
			panic(err)
		}

		sort.Slice(a, func(i, j int) bool {
			return a[i] > a[j]
		})

		if isPossible(n, m, k, a) || isPossible(m, n, k, a) {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}

}

// basically the trick is pairing (2) the rows or columns
func isPossible(n, m, k int, a []int) bool {
	excess := false // 1 color has more than enough to pair
	var num int
	for i := 0; i < k; i++ {
		num = a[i] / m // number of rows that color can fill
		if num >= 2 {
			if n == 1 {
				if excess {
					return true
				}
				return false // if num == 2 we don't have enough
			} else {
				n -= num
			}
		}
		if num >= 3 {
			excess = true
		}
		if n <= 0 { // filled all rows
			return true
		}
	}
	return false

}

package main

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

func main() {
	scanner := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var ntests int
	fmt.Fscan(scanner, &ntests)
outer:
	for iter := 0; iter < ntests; iter++ {
		var n, m, k int
		fmt.Fscan(scanner, &n, &m, &k)
		slice := make([]int, k)
		mslice := make([]int, k)
		nslice := make([]int, k)
		for i := 0; i < k; i++ {
			var tmp int
			fmt.Fscan(scanner, &tmp)
			slice[i] = tmp
			mslice[i] = tmp / m
			nslice[i] = tmp / n
		}
		sort.Slice(mslice, func(i, j int) bool { return mslice[i] < mslice[j] })
		sort.Slice(nslice, func(i, j int) bool { return nslice[i] < nslice[j] })
		left := m
		for i := 0; i < k; i++ {
			if nslice[i] >= 2 {
				if (left - nslice[i]) != 1 {
					left = left - nslice[i]
				} else {
					if nslice[i] != 2 {
						left = left - nslice[i] + 1
					}
				}
			}
			if left <= 0 {
				break
			}
		}
		if left <= 0 {
			fmt.Fprintln(writer, "Yes")
			continue outer
		}
		left = n
		for i := 0; i < k; i++ {
			if mslice[i] >= 2 {
				if (left - mslice[i]) != 1 {
					left = left - mslice[i]
				} else {
					if mslice[i] != 2 {
						left = left - mslice[i] + 1
					}
				}
			}
			if left <= 0 {
				break
			}
		}
		if left <= 0 {
			fmt.Fprintln(writer, "Yes")
			continue outer
		}
		fmt.Fprintln(writer, "No")
	}
}

package main

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

var _, _, _ = main, rw, do

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	rw(r, w)
}

func rw(r io.Reader, w io.Writer) {
	var t int
	fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		var n, m, k int
		fmt.Fscan(r, &n, &m, &k)
		a := make([]int, k)
		for i := range a {
			fmt.Fscan(r, &a[i])
		}
		w1 := do(n, m, k, a)
		fmt.Fprintln(w, w1)
	}
}

func do(n, m, k int, a []int) string {
	sort.Ints(a)
	if f(n, m, k, a) || f(m, n, k, a) {
		return "Yes"
	}
	return "No"
}

func f(n, m, k int, a []int) bool {
	if m == 1 {
		return a[k-1] >= n
	}
	c := 0
	for i := 0; i < k && m > 0; i++ {
		b := a[i] / n
		if b >= 2 {
			if m == 1 {
				if c == 0 {
					if b >= 3 {
						m = 0
					}
				} else {
					m = 0
				}
			} else {
				m -= b
			}
		}
		if b >= 3 {
			c++
		}
	}
	return m <= 0
}

package main

import (
	"bufio"
	"math"
	"os"
	"strconv"
)

func solve() {
	n := get64()
	m := get64()
	k := get()
	a := get64a(k)

	i := L(0)
	j := L(0)
	i2, j2 := true, true
	for _, v := range a {
		t := v / m
		if t > 1 {
			i += t
			if t != 2 {
				i2 = false
			}
		}
		t = v / n
		if t > 1 {
			j += t
			if t != 2 {
				j2 = false
			}
		}
		if i >= n && (!i2 || n%2 == 0) || j >= m && (!j2 || m%2 == 0) {
			yes()
			return
		}
	}
	no()
}

const (
	once       = false
	maxBufSize = 0 //10000000
	YES        = "Yes"
	NO         = "No"
)

var (
	splitFunc = bufio.ScanWords //bufio.SplitFunc(nil)
)

func main() {
	in = bufio.NewScanner(bufio.NewReader(os.Stdin))
	if splitFunc != nil {
		in.Split(splitFunc)
	}
	if maxBufSize > 0 {
		in.Buffer(make([]byte, maxBufSize), maxBufSize)
	}

	out = bufio.NewWriter(os.Stdout)
	defer out.Flush()

	if once {
		solve()
		return
	}

	t := get()
	for t > 0 {
		solve()
		t--
	}
}

var (
	in  *bufio.Scanner
	out *bufio.Writer
)

func get() int {
	x, _ := strconv.Atoi(gets())
	return x
}

func geta(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = get()
	}
	return a
}

func geta1(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = get() - 1
	}
	return a
}

func get64() int64 {
	x, _ := strconv.ParseInt(gets(), 10, 64)
	return x
}

func get64a(n int) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = get64()
	}
	return a
}

func get64a1(n int) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = get64() - 1
	}
	return a
}

func getf() float64 {
	x, _ := strconv.ParseFloat(gets(), 64)
	return x
}

func getfa(n int) []float64 {
	a := make([]float64, n)
	for i := range a {
		a[i] = getf()
	}
	return a
}

func gets() string {
	scan()
	return in.Text()
}

func scanN(n int) {
	for n > 0 {
		scan()
		n--
	}
}

func scan() {
	in.Scan()
}

func putc(c rune) {
	out.WriteRune(c)
}

func line() {
	putc('\n')
}

func space() {
	putc(' ')
}

func put(x int) {
	out.WriteString(strconv.Itoa(x))
}

func putln(i int) {
	put(i)
	line()
}

func puta(a []int) {
	for _, v := range a {
		put(v)
		space()
	}
	line()
}

func put64(x int64) {
	out.WriteString(strconv.FormatInt(x, 10))
}

func put64ln(x int64) {
	put64(x)
	line()
}

func put64a(a []int64) {
	for _, v := range a {
		put64(v)
		space()
	}
	line()
}

func puts(s string) {
	out.WriteString(s)
}

func putsln(s string) {
	puts(s)
	line()
}

func yn(y bool) {
	if y {
		yes()
		return
	}
	no()
}

func yes() {
	puts(YES)
	line()
}

func no() {
	puts(NO)
	line()
}

func putf(x float64) {
	out.WriteString(strconv.FormatFloat(x, 'f', -1, 64))
}

func putfln(x float64) {
	putf(x)
	line()
}

func putfa(a []float64) {
	for _, v := range a {
		putf(v)
		space()
	}
	line()
}

type IntTp interface {
	int | int64
}

type Tp interface {
	IntTp | float64
}

func abs[T IntTp](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func fabs(x float64) float64 {
	return math.Abs(x)
}

func max1[T Tp](x T, y T) T {
	if x > y {
		return x
	}
	return y
}

func max[T Tp](xs ...T) T {
	r := xs[0]
	for _, x := range xs[1:] {
		r = max1(r, x)
	}
	return r
}

func maxa[T Tp](a []T) (i int, val T) {
	i, val = 0, a[0]
	for j := 1; j < len(a); j++ {
		if a[j] <= val {
			continue
		}
		i = j
		val = a[j]
	}
	return
}

func min1[T Tp](x T, y T) T {
	if x < y {
		return x
	}
	return y
}

func min[T Tp](xs ...T) T {
	r := xs[0]
	for _, x := range xs[1:] {
		r = min1(r, x)
	}
	return r
}

func mina[T Tp](a []T) (i int, val T) {
	i, val = 0, a[0]
	for j := 1; j < len(a); j++ {
		if a[j] >= val {
			continue
		}
		i = j
		val = a[j]
	}
	return
}

func L(i int) int64 {
	return int64(i)
}

func F(i int) float64 {
	return float64(i)
}

func ints(n int, val int) (a []int) {
	a = make([]int, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

func int64s(n int, val int64) (a []int64) {
	a = make([]int64, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

func floats(n int, val float64) (a []float64) {
	a = make([]float64, n)
	if val == 0 {
		return
	}
	for i := range a {
		a[i] = val
	}
	return
}

const heapBase = 4

func children(i int) (int, int) {
	start := heapBase * i
	return start + 1, start + (1 + heapBase)
}

func parent(i int) int {
	return (i - 1) / heapBase
}

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func _int() int {
	s := _string()
	i := 0
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int(r - '0')
	}
	return i
}

func _int64() int64 {
	s := _string()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func _string() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func main() {
	defer writer.Flush()
	for t := _int(); t > 0; t-- {
		n := _int64()
		m := _int64()
		k := _int64()
		a := make([]int64, k)
		for i := range a {
			a[i] = _int64()
		}
		printf("%s\n", sol(n, m, k, a))
	}
}

func sol(n, m, k int64, a []int64) string {
	if sum(a) < n*m {
		return "No"
	}
	if try(n, m, a) || try(m, n, a) {
		return "Yes"
	}
	return "No"
}

func sum(a []int64) int64 {
	ret := int64(0)
	for i := range a {
		ret += a[i]
	}
	return ret
}

func try(n, m int64, a []int64) bool {
	tmp := int64(0)
	hasOdd := false
	for i := range a {
		curr := a[i] / n
		if curr >= 2 {
			tmp += curr
		}
		if curr >= 3 {
			hasOdd = true
		}
	}
	if m&1 == 1 {
		return tmp >= m && hasOdd
	}
	return tmp >= m
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < (n) {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < int64(n) {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"sort"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	var buf bytes.Buffer

	tc := readNum(reader)

	for tc > 0 {
		tc--
		m, n, k := readThreeNums(reader)
		A := readNNums(reader, k)
		res := solve(A, m, n)
		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

func readString(reader *bufio.Reader) string {
	s, _ := reader.ReadString('\n')
	for i := 0; i < len(s); i++ {
		if s[i] == '\n' || s[i] == '\r' {
			return s[:i]
		}
	}
	return s
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}
func solve(A []int, m int, n int) bool {
	if m == 1 || n == 1 {
		return false
	}
	sort.Ints(A)
	reverse(A)

	return check(A, m, n) || check(A, n, m)
}

func reverse(arr []int) {
	for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
		arr[i], arr[j] = arr[j], arr[i]
	}
}

func check(A []int, m int, n int) bool {

	for i := 0; i < len(A) && m > 0; i++ {
		x := A[i] / n
		if x <= 1 {
			return false
		}
		// x >= 2
		if m == 1 {
			// 最后一列了
			return A[0]/n > 2
		}
		m -= x
	}
	return m <= 0
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

func readInt() int {
	var value int
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInt64() int64 {
	var value int64
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readString() string {
	var value string
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	return a
}

func readInts64(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = readInt64()
	}
	return a
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(bufferedStdout, format, value...)
}

func printErr(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(os.Stderr, format, value...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func canFill(n, m int64, a []int64) bool {
	size := n * m
	sum := int64(0)
	using := make([]bool, len(a))
	for i := 0; i < len(a); i++ {
		if n > 1 && a[i]/m > 1 {
			sum += 2 * m
			n -= 2
			using[i] = true
		}
	}
	for i := 0; i < len(a); i++ {
		if using[i] {
			sum += (a[i] - 2*m) / m * m
			n -= min64((a[i]-2*m)/m, n)
		}
	}
	return sum >= size
}

func solve() {
	var n, m, k = readInt64(), readInt64(), readInt64()
	a := readInts64(int(k))
	if canFill(n, m, a) || canFill(m, n, a) {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

func main() {
	var t = 1
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

func readInt() int {
	var value int
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInt64() int64 {
	var value int64
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readString() string {
	var value string
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	return a
}

func readInts64(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = readInt64()
	}
	return a
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(bufferedStdout, format, value...)
}

func printErr(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(os.Stderr, format, value...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func canFill(n, m int64, a []int64) bool {
	if n%2 == 1 && a[len(a)-1] < 3*m {
		return false
	}
	add := int64(0)
	if n%2 == 1 {
		a[len(a)-1] -= 3 * m
		add = 3 * m
	}
	sum := add
	for i := len(a) - 1; i >= 0; i-- {
		sum += a[i] / (2 * m) * 2 * m
	}
	a[len(a)-1] += add

	return sum >= n*m
}

func solve() {
	var n, m, k = readInt64(), readInt64(), readInt64()
	b := readInts(int(k))
	sort.Ints(b)
	a := make([]int64, k)
	for i := 0; i < int(k); i++ {
		a[i] = int64(b[i])
	}
	if canFill(n, m, a) || canFill(m, n, a) {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

func main() {
	var t = 1
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

func readInt() int {
	var value int
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readString() string {
	var value string
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	return a
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(bufferedStdout, format, value...)
}

func printErr(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(os.Stderr, format, value...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func canFill(n, m int, a []int) bool {
	if n%2 == 1 && a[len(a)-1] < 3*m {
		return false
	}
	add := 0
	if n%2 == 1 {
		a[len(a)-1] -= 3 * m
		add = 3 * m
	}
	sum := 0
	for i := len(a) - 1; i >= 0; i-- {
		sum += a[i] / (2 * m) * 2 * m
	}
	a[len(a)-1] += add

	return sum+add >= n*m
}

func solve() {
	var n, m, k = readInt(), readInt(), readInt()
	a := readInts(k)
	sort.Ints(a)
	if canFill(n, m, a) || canFill(m, n, a) {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

func main() {
	var t = 1
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

var bufferedStdin = bufio.NewReader(os.Stdin)
var bufferedStdout = bufio.NewWriter(os.Stdout)

func readInt() int {
	var value int
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readString() string {
	var value string
	_, _ = fmt.Fscan(bufferedStdin, &value)
	return value
}

func readInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	return a
}

func printf(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(bufferedStdout, format, value...)
}

func printErr(format string, value ...interface{}) {
	_, _ = fmt.Fprintf(os.Stderr, format, value...)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func canFill(n, m int, a []int) bool {
	if n%2 == 1 && a[len(a)-1] < 3*m {
		return false
	}
	add := 0
	if n%2 == 1 {
		a[len(a)-1] -= 3 * m
		add = 3 * m
	}
	sum := 0
	for i := len(a) - 1; i >= 0; i-- {
		sum += a[i] / (2 * m) * 2 * m
	}
	a[len(a)-1] += add

	return sum >= (n-add)*m
}

func solve() {
	var n, m, k = readInt(), readInt(), readInt()
	a := readInts(k)
	sort.Ints(a)
	if canFill(n, m, a) || canFill(m, n, a) {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

func main() {
	var t = 1
	_, _ = fmt.Fscan(bufferedStdin, &t)
	for i := 0; i < t; i++ {
		solve()
	}
	_ = bufferedStdout.Flush()
}

package main

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

func A5() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		var n, m, k int
		Fscan(in, &n, &m, &k)
		a := make([]int, k)
		for i := 0; i < k; i++ {
			Fscan(in, &a[i])
		}

		var s func(r, c int) bool
		s = func(r, c int) bool {
			var cur int64
			var f, f2 int
			for i := 0; i < k; i++ {
				var t = a[i] / r
				if t >= 3 {
					f2 = 1
				}
				if (t & 1) == 1 {
					cur += int64(t - 1)
					f++
				} else if t >= 2 {
					cur += int64(t)
				}
			}
			if int64(c) <= cur {
				if ((cur - int64(c)) & 1) == 0 {
					return true
				} else {
					if f2 > 0 {
						return true
					} else {
						return false
					}
				}
			} else {
				var need = int64(c) - cur
				if need > int64(f) {
					return false
				} else {
					return true
				}
			}
		}
		if s(m, n) || s(n, m) {
			Fprintln(out, "Yes")
		} else {
			Fprintln(out, "No")
		}
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A5() }

package main

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

func A5() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		var n, m, k int
		Fscan(in, &n, &m, &k)
		a := make([]int, k)
		for i := 0; i < k; i++ {
			Fscan(in, &a[i])
		}
		var s func(r, c int) bool
		s = func(r, c int) bool {
			var cur int64
			var f int
			for i := 0; i < k; i++ {
				var t = a[i] / r
				if t >= 3 && (t&1) == 1 {
					cur += int64(t - 1)
					f++
				} else if t >= 2 {
					cur += int64(t)
				}
			}
			if int64(c) <= cur {
				if ((cur - int64(c)) & 1) == 0 {
					return true
				} else {
					if f > 0 {
						return true
					} else {
						return false
					}
				}
			} else {
				var need = int64(c) - cur
				if need > int64(f) {
					return false
				} else {
					return true
				}
			}
		}
		if s(m, n) || s(n, m) {
			Fprintln(out, "Yes")
		} else {
			Fprintln(out, "No")
		}
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A5() }

package main

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

func A5() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		var n, m, k int
		Fscan(in, &n, &m, &k)
		a := make([]int, k)
		for i := 0; i < k; i++ {
			Fscan(in, &a[i])
		}
		var s func(r, c int) bool
		s = func(r, c int) bool {
			var cur int
			var f int
			for i := 0; i < k; i++ {
				var t = a[i] / r
				if t >= 3 && (t&1) == 1 {
					cur += (t - 1)
					f++
				} else if t >= 2 {
					cur += t
				}
			}
			if c <= cur {
				if ((cur - c) & 1) == 0 {
					return true
				} else {
					if f > 0 {
						return true
					} else {
						return false
					}
				}
			} else {
				var need = c - cur
				if need > f {
					return false
				} else {
					return true
				}
			}
		}
		if s(m, n) || s(n, m) {
			Fprintln(out, "Yes")
		} else {
			Fprintln(out, "No")
		}
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A5() }

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n, m, k int
		fmt.Fscan(in, &n, &m, &k)

		aa := make([]int, k)
		for i := 0; i < k; i++ {
			fmt.Fscan(in, &aa[i])
		}
		sort.Slice(aa, func(i, j int) bool { return aa[i] > aa[j] })

		solve := func(n, m int) bool {
			g := m
			var f bool
			for _, v := range aa {
				d := v / n
				if d < 2 && g > 0 {
					return false
				} else if d > 2 {
					f = true
				}
				g -= d
			}
			return g == 0 || g < -1 || (g == -1 && f)
		}
		if solve(n, m) || solve(m, n) {
			fmt.Fprintln(out, "Yes")
		} else {
			fmt.Fprintln(out, "No")
		}
	}
}

    package main

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

    type Int uint64
    var dnl = "%d\n"
    var snl = "%s\n"
    var dddnl = "%d %d %d\n"

    func main() {
    	defer writer.Flush()

    	dPtr := &dnl
    	sPtr := &snl
    	dddPtr := &dddnl

    	var (
    		solved     bool
    		t, n, m, k Int
    		eln, tot   Int
    		gte3       Int
    		astr 	   string
    	)

    	scanf(*dPtr, &t)

    	for ; t>0; t-- {
    		solved = true
    		tot = 0
    		gte3 = 0
    		scanf(*dddPtr, &n, &m, &k)
    		scanln(&astr)

    		a := StrToIntSlice(astr)

    		for i := range a {
    			eln = a[i] / n
    			if eln > 1 {
    				tot += eln
    				if eln > 2 && gte3 == 0 {
    					gte3++
    				}
    			}
    		}
    		if tot < m {
    			solved = !solved
    		}
    		if m%2!=0 {
    			if gte3 <= 0 {
    				solved = !solved
    			}
    		}
    		printf(*sPtr, yesNoMap(solved))
    	}
    }

    func SplitString(str string) []string {
    	return strings.Fields(str)
    }

    func Atoi(str string) Int {
    	out, _ := strconv.ParseInt(str, 10, 64)
    	return Int(out)
    }

    func StrToIntSlice(str string) []Int {
    	sarr := SplitString(str)
    	iarr := make([]Int, len(sarr))
    	for i := range sarr {
    		iarr[i] = Atoi(sarr[i])
    	}
    	return iarr
    }

    func yesNoMap(b bool) string {
    	return map[bool]string{false: "NO", true: "YES"}[b]
    }

    var reader *bufio.Reader = bufio.NewReader(os.Stdin)
    func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
    var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
    func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
    func scanln(s *string) { *s, _ = reader.ReadString('\n') }

package main

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

type Int uint32
var dnl = "%d\n"
var snl = "%s\n"
var dddnl = "%d %d %d\n"

func main() {
	defer writer.Flush()

	dPtr := &dnl
	sPtr := &snl
	dddPtr := &dddnl

	var (
		solved     bool
		t, n, m, k Int
		eln, tot   Int
		gte3       Int
		astr 	   string
	)

	scanf(*dPtr, &t)

	for ; t>0; t-- {
		solved = true
		tot = 0
		gte3 = 0
		scanf(*dddPtr, &n, &m, &k)
		scanln(&astr)

		a := StrToIntSlice(astr)

		for i := range a {
			eln = a[i] / n
			if eln > 1 {
				tot += eln
				if eln > 2 && gte3 == 0 {
					gte3++
				}
			}
		}
		if tot < m {
			solved = !solved
		}
		if m%2!=0 {
			if gte3 <= 0 {
				solved = !solved
			}
		}
		printf(*sPtr, yesNoMap(solved))
	}
}

func SplitString(str string) []string {
	return strings.Fields(str)
}

func Atoi(str string) Int {
	out, _ := strconv.ParseInt(str, 10, 64)
	return Int(out)
}

func StrToIntSlice(str string) []Int {
	sarr := SplitString(str)
	iarr := make([]Int, len(sarr))
	for i := range sarr {
		iarr[i] = Atoi(sarr[i])
	}
	return iarr
}

func yesNoMap(b bool) string {
	return map[bool]string{false: "NO", true: "YES"}[b]
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanln(s *string) { *s, _ = reader.ReadString('\n') }

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var s string
	s, err := reader.ReadString('\n')
	if err != nil {
		panic(err)
	}

	tests, err := strconv.Atoi(s[:len(s)-2])
	if err != nil {
		panic(err)
	}

	var n, m, k int
	for i := 0; i < tests; i++ {
		s, err = reader.ReadString(' ')
		if err != nil {
			panic(err)
		}

		n, err = strconv.Atoi(s[:len(s)-1])
		if err != nil {
			panic(err)
		}

		s, err = reader.ReadString(' ')
		if err != nil {
			panic(err)
		}

		m, err = strconv.Atoi(s[:len(s)-1])
		if err != nil {
			panic(err)
		}

		s, err = reader.ReadString('\n')
		if err != nil {
			panic(err)
		}

		k, err = strconv.Atoi(s[:len(s)-2])
		if err != nil {
			panic(err)
		}

		a := make([]int, k)
		for i := 0; i < k-1; i++ {
			s, err = reader.ReadString(' ')
			if err != nil {
				panic(err)
			}

			a[i], err = strconv.Atoi(s[:len(s)-1])
			if err != nil {
				panic(err)
			}
		}

		s, err = reader.ReadString('\n')
		if err != nil {
			panic(err)
		}

		a[k-1], err = strconv.Atoi(s[:len(s)-2])
		if err != nil {
			panic(err)
		}

		sort.Slice(a, func(i, j int) bool {
			return a[i] < a[j]
		})

		if isPossible(n, m, k, a) || isPossible(m, n, k, a) {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}

}

// basically the trick is pairing (2) the rows or columns
func isPossible(n, m, k int, a []int) bool {
	excess := false // 1 color has more than enough to pair
	var num int
	for i := 0; i < k; i++ {
		num = a[i] / m // number of rows that color can fill
		if num >= 2 {
			if n == 1 {
				if excess {
					return true
				}
				return false // if num == 2 we don't have enough
			} else {
				n -= num
			}
		}
		if num >= 3 {
			excess = true
		}
		if n <= 0 { // filled all rows
			return true
		}
	}
	return false

}

package main

import (
	"fmt"
)

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < n {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	fmt.Scanln(a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for i:=0;i<t;i++{
		solve()
	}
}

package main

import (
	"fmt"
)

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < n {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	fmt.Scanln(a[:k])
	fmt.Println(k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for i:=0;i<t;i++{
		solve()
	}
}

package main

import (
	"fmt"
)

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < n {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	fmt.Scanln(a[:k])
	fmt.Println(a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for i:=0;i<t;i++{
		solve()
	}
}

package main

import (
	"fmt"
)

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < n {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	fmt.Scanln(a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for i:=0;i<t;i++{
		solve()
	}
}

package main

import (
	"fmt"
)

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < n {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(cnt)
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	fmt.Scanln(n, m, k)
	fmt.Scanln(a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(t)
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := (0)
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(cnt)
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(cnt)
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*4
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := (a[i]) / (m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < (n) {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(cnt)
	}
	if n % 2 == 1 {
		return cnt >= (n) && flg
	}
	return cnt >= (n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024*2
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < int64(n) {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(n, m, k, a[:10], cnt, flg)
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < int64(n) {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(n, m, k, a[:10], cnt, flg)
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < int64(n) {
			cnt += t
		}
	}
	if n == 4 && m == 4 && k == 100000 {
		fmt.Println(n, m, k, len(a), cnt, flg)
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 && cnt < int64(n) {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	if k == 100000 {
		fmt.Println(a[k-1])
	}
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 1024*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)
const maxCapacity = 512*1024
var buf= make([]byte, maxCapacity)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	if k == 100000 {
		scanner.Scan()
		scanner.Scan()
		s := strings.Split(scanner.Text(), " ")
		fmt.Println(len(s), scanner.Text()[len(scanner.Text())-9:])
		return
	}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Buffer(buf, maxCapacity)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	if k == 100000 {
		scanner.Scan()
		scanner.Scan()
		s := strings.Split(scanner.Text(), " ")
		fmt.Println(len(s), scanner.Text()[len(scanner.Text())-9:])
		return
	}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	if k == 100000 {
		scanner.Scan()
		scanner.Scan()
		s := strings.Split(scanner.Text(), " ")
		fmt.Println(len(s), s)
		return
	}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	if k == 100000 {
		scanner.Scan()
		scanner.Scan()
		s := strings.Split(scanner.Text(), " ")
		fmt.Println(len(s))
		return
	}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	if k == 100000 {
		scanner.Scan()
		s := strings.Split(scanner.Text(), " ")
		fmt.Println(len(s))
		return
	}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	//if t == 10 {
	//	for j := 0; j < t * 2; j++ {
	//		scanner.Scan()
	//		s := strings.Split(scanner.Text(), " ")
	//		fmt.Println(len(s))
	//	}
	//	return
	//}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	//if k == 10000 {
	//	for i := 0; i < 3; i++ {
	//		scanner.Scan()
	//		s = strings.Split(scanner.Text(), " ")
	//		fmt.Println(s)
	//	}
	//	return
	//}
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	if t == 10 {
		for j := 0; j < t * 2; j++ {
			scanner.Scan()
			s := strings.Split(scanner.Text(), " ")
			fmt.Println(len(s))
		}
		return
	}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	//if k == 10000 {
	//	for i := 0; i < 3; i++ {
	//		scanner.Scan()
	//		s = strings.Split(scanner.Text(), " ")
	//		fmt.Println(s)
	//	}
	//	return
	//}
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	if t == 10 {
		for j := 0; j < t * 2; j++ {
			scanner.Scan()
			fmt.Println(len(scanner.Text()))
		}
		return
	}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	//if k == 10000 {
	//	for i := 0; i < 3; i++ {
	//		scanner.Scan()
	//		s = strings.Split(scanner.Text(), " ")
	//		fmt.Println(s)
	//	}
	//	return
	//}
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	if t == 10 {
		for j := 0; j < t * 2; j++ {
			scanner.Scan()
			fmt.Println(scanner.Text())
		}
		return
	}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	//if k == 10000 {
	//	for i := 0; i < 3; i++ {
	//		scanner.Scan()
	//		s = strings.Split(scanner.Text(), " ")
	//		fmt.Println(s)
	//	}
	//	return
	//}
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	if t == 10 {
		for j := 0; j < t * 2; j++ {
			fmt.Println(scanner.Text())
		}
		return
	}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	if len(str) == 0 {
		fmt.Println("ikkkk")
		scanln(arr)
		return
	}
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	//if k == 10000 {
	//	for i := 0; i < 3; i++ {
	//		scanner.Scan()
	//		s = strings.Split(scanner.Text(), " ")
	//		fmt.Println(s)
	//	}
	//	return
	//}
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	if t == 10 {
		for scanner.Scan() {
			fmt.Println(scanner.Text())
		}
		return
	}
	for i:=0;i<t;i++{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if k == 10000 {
			fmt.Println("ikkkk")
		}
		s := scanner.Text()
		if k == 10000 {
			fmt.Println(s)
		}
		s = strings.Trim(s, " ")
		if s != "" {
			if k == 10000 {
				fmt.Printf("ikk%skk", s)
			}
			scanlnInts(arr, s)
			break
		}
	}
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := int64(0)
	for i := 0; i < k; i++ {
		t := int64(a[i]) / int64(m)
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= int64(n) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanner.Scan()
	s = strings.Split(scanner.Text(), " ")
	fmt.Println(s)
	return
	//if len(s) > 3 {
	//	for idx, val := range s[3:]{
	//		a[idx], _ = strconv.Atoi(val)
	//	}
	//} else {
	//	scanln(a[:])
	//}
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		s := scanner.Text()
		strings.Trim(s, s)
		if s != "" {
			scanlnInts(arr, s)
			break
		}
	}
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	var cnt int64 = 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1{
			cnt += int64(n)
		}
	}
	if n % 2 == 1 {
		return cnt >= (int64(n)) && flg
	}
	return cnt >= int64(n)
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	if k >= 10000{
		fmt.Println(",ikkkk", scanner.Text(), len(scanner.Text()))
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			break
		}
		fmt.Println(1)
	}
	if k >= 10000{
		fmt.Println(",ikkkk", scanner.Text())
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			if k >= 10000{
				fmt.Println(",ikkkk", scanner.Text())
			}
			break
		}
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			if k >= 10000{
				fmt.Println(scanner.Text())
			}
			break
		}
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			fmt.Println(scanner.Text())
			break
		}
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			break
		}
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			fmt.Println(len(str), len(s))
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() {
		if len(scanner.Text()) != 0{
			break
		}
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			scanner.Scan()
			fmt.Println(scanner.Text())
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() && len(scanner.Text()) == 0 {
		fmt.Println(1)
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			scanner.Scan()
			fmt.Println(scanner.Text())
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	for scanner.Scan() && scanner.Text() == "" {
	}
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			scanner.Scan()
			fmt.Println(scanner.Text())
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
			scanner.Scan()
			fmt.Println(scanner.Text())
			return
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(n, m, k, str)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(a, idx)
			//fmt.Println(str[idx:idx+10])
			fmt.Println(str)
			fmt.Println(err)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	str := strings.Split(s, " ")
	for idx, a := range str{
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(a, idx)
			//fmt.Println(str[idx:idx+10])
			fmt.Println(err)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	for idx, a := range strings.Split(s, " "){
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(a)
			fmt.Println(err)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	for idx, a := range strings.Split(s, " "){
		if idx >= k {
			break
		}
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(err)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	for idx, a := range strings.Split(s, " "){
		var err error
		arr[idx], err = strconv.Atoi(a)
		if err != nil {
			fmt.Println(err)
		}
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var scanner = bufio.NewScanner(os.Stdin)

func scanln(arr []int) {
	scanner.Scan()
	scanlnInts(arr, scanner.Text())
}

func scanlnInts(arr []int, s string) {
	for idx, a := range strings.Split(s, " "){
		arr[idx], _ = strconv.Atoi(a)
	}
}

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	n, _ = strconv.Atoi(s[0])
	m, _ = strconv.Atoi(s[1])
	k, _ = strconv.Atoi(s[2])
	scanln(a[:])
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var stdin = bufio.NewReader(os.Stdin)

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scan(&a[i])
	}
	fmt.Scanln()
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for ;t>0;t--{
		solve()
	}
}

package main

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

var a = [100010]int{}
var n, m, k int

var stdin = bufio.NewReader(os.Stdin)

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanln(&n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scan(&a[i])
	}
	//fmt.Scanln()
	//fmt.Println("ikkkkk2", a[:k])
	//fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanln(&t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d%d%d\n", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	fmt.Scanln()
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d%d%d\n", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d%d%d\n", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d %d %d\n", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d ", &a[i])
	}
	fmt.Scanf("\n")
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d %d %d", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d %d %d", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d%d%d", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	fmt.Println(n, m, k, a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import "fmt"

var a = [100010]int{}
var n, m, k int

func check(n, m, k int) bool{
	flg := false
	cnt := 0
	for i := 0; i < k; i++ {
		t := a[i] / m
		if t > 2 {
			flg = true
		}
		if t > 1 {
			cnt += t
		}
	}
	if n % 2 == 1 {
		return cnt >= n && flg
	}
	return cnt >= n
}

func solve() {
	fmt.Scanf("%d%d%d", &n, &m, &k)
	for i := 0; i < k; i++{
		fmt.Scanf("%d", &a[i])
	}
	//fmt.Println("ikkkkk2", a[:k])
	if check(n, m, k) || check(m, n, k) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for ;t>0;t--{
		solve()
	}
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"sort"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	var buf bytes.Buffer

	tc := readNum(reader)

	for tc > 0 {
		tc--
		m, n, k := readThreeNums(reader)
		A := readNNums(reader, k)
		res := solve(A, m, n)
		if res {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}

	fmt.Print(buf.String())
}

func readString(reader *bufio.Reader) string {
	s, _ := reader.ReadString('\n')
	for i := 0; i < len(s); i++ {
		if s[i] == '\n' || s[i] == '\r' {
			return s[:i]
		}
	}
	return s
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}
func solve(A []int, m int, n int) bool {
	if m == 1 || n == 1 {
		return false
	}
	sort.Ints(A)
	reverse(A)

	return check(A, m, n) || check(A, n, m)
}

func reverse(arr []int) {
	for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
		arr[i], arr[j] = arr[j], arr[i]
	}
}

func check(A []int, m int, n int) bool {

	for i := 0; i < len(A) && m > 0; i++ {
		x := A[i] / n
		if x <= 1 {
			return false
		}
		// x >= 2
		if m == 1 {
			// 最后一列了
			return A[0]/n > 2
		}
		m -= x
	}
	return m == 0
}