package main

import (
	"fmt"
	"sort"
)

func main() {
	var tries int
	_, _ = fmt.Scan(&tries)

	for i := 0; i < tries; i++ {
		var count int
		_, _ = fmt.Scan(&count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			_, _ = fmt.Scan(&adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count-1; k++ {
			if adads[k+1]-adads[k] >= 2 {
				flag = true
				break
			}
		}

		if flag {
			fmt.Println("NO")

		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"sync"
)
var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup
func GetNum(p string)int64{
	var ans int64 = 0
	flag:=true
	i:=0
	n:=len(p)
	if p[i]=='-'{
		flag=false
		i++
	}
	for ;i<n;i++{
		ans=(ans<<1)+(ans<<3)+int64(p[i]-'0')
	}
	if !flag{
		ans=-ans
	}
	return ans
}
func ReadString() string {
	in.Scan()
	return in.Text()
}
func ReadStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ReadString()
	}
	return s
}
func ReadInt() int {
	intStr := ReadString()
	return int(GetNum(intStr))
}
func ReadIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ReadInt()
	}
	return arr
}
func ReadInt64() int64 {
	int64Str:=ReadString()
	return GetNum(int64Str)
}
func ReadInt64Slice(n int)[] int64{
	arr:=make([]int64,n)
	for i:=0;i<n;i++{
		arr[i] = ReadInt64()
	}
	return arr
}

func init() {

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1<<10), int(2e+5))
	in.Split(bufio.ScanWords)

	out = make(chan string, 1<<4)
	outWg = &sync.WaitGroup{}
	outWg.Add(1)
	writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
	go func(write *bufio.Writer) {
		defer outWg.Done()
		defer write.Flush()
		for line := range out {
			write.WriteString(line + "\n")
		}
	}(writer)
}
func work(){
	n:=ReadInt()
	a:=ReadIntSlice(n)
	sort.Ints(a)
	f:=true
	for i:=1;i<len(a);i++{
		if a[i]-a[i-1] >1{
			fmt.Println("NO")
			f=false
			break
		}
	}
	if f{
		fmt.Println("YES")
	}
}

func main(){
	for t:=ReadInt();t>0;t--{
		work()
	}
	close(out)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var T int
	fmt.Scan(&T)
	for i := 0; i < T; i++ {
		var n int
		fmt.Scan(&n)
		var v []int
		for j := 0; j < n; j++ {
			var curr int
			fmt.Scan(&curr)
			v = append(v, curr)
		}
		sort.Ints(v)
		flag := true
		for j := n - 2; j >= 0; j-- {
			if v[j+1]-v[j] > 1 {
				flag = false
				break
			}
		}
		if flag == false {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func main() {
	var t, n, a int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans := "YES"
		input := make([]int, 0)
		fmt.Fscan(in, &n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a)
			input = append(input, a)
		}
		sort.Slice(input, func(i, j int) bool {
			return input[i] < input[j]
		})
		for j := 1; j < n; j++ {
			if abs(input[j]-input[j-1]) > 1 {
				ans = "NO"
			}
		}
		fmt.Println(ans)
	}

}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

package main

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

func main() {
	var tn int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &tn)
	for i := 0; i < tn; i++ {
		var tsSize int
		fmt.Fscan(in, &tsSize)
		var ts []int
		for i := 0; i < tsSize; i++ {
			var item int
			fmt.Fscan(in, &item)
			ts = append(ts, item)
		}
		sort.Ints(ts)
		var yes = true
		for i := 0; i < tsSize-1; i++ {
			var dif =  ts[i+1] - ts[i]
			if dif > 1 {
				yes = false
			}
		}
		if yes {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var tn int
	fmt.Scan(&tn)
	for i := 0; i < tn; i++ {
		var tsSize int
		fmt.Scan(&tsSize)
		var ts []int
		for i := 0; i < tsSize; i++ {
			var item int
			fmt.Scan(&item)
			ts = append(ts, item)
		}
		sort.Ints(ts)
		 var yes = true
		for i := 0; i < tsSize-1; i++ {
			var dif =  ts[i+1] - ts[i]
			if dif > 1 {
				yes = false
			}
		}
		if yes {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

const MaxN int = 50 + 5

var read *bufio.Reader = bufio.NewReader(os.Stdin)
var write *bufio.Writer = bufio.NewWriter(os.Stdout)
var num []int

func quickSort(arr []int, left int, right int) {
	if left < right {
		partitionIndex := partition(arr, left, right)
		quickSort(arr, left, partitionIndex-1)
		quickSort(arr, partitionIndex+1, right)
	}
}

func partition(arr []int, left int, right int) int {
	var res = left + 1
	for i := res; i <= right; i++ {
		if arr[i] < arr[left] {
			swap(arr, i, res)
			res += 1
		}
	}
	swap(arr, left, res-1)
	return res - 1
}

func swap(arr []int, i int, j int) {
	arr[i], arr[j] = arr[j], arr[i]
}

func abs(x int) int {
	if x < 0 {
		return -x
	} else {
		return x
	}
}

func main() {
	defer write.Flush()
	var t int
	fmt.Fscan(read, &t)
	for ; t > 0; t-- {
		var n int
		fmt.Fscan(read, &n)
		num = make([]int, n, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(read, &num[i])
		}
		quickSort(num, 0, n-1)
		var flag bool = true
		for i := 1; i < n; i++ {
			if abs(num[i]-num[i-1]) > 1 {
				flag = false
				break
			}
		}
		//fmt.Fprintln(write, num[0:n])
		if flag {
			fmt.Fprintln(write, "YES")
		} else {
			fmt.Fprintln(write, "NO")
		}
	}
}

package main

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

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

	T:= 0
	for Fscan(in, &T); T > 0; T-- {
		var n int
		Fscan(in, &n)
		a:=make([]int,n)
		for i:=0;i<n;i++{
			Fscan(in,&a[i])
		}
		sort.Ints(a)
		fl:=true
		for i:=0;i+1<n;i++{
			if a[i+1]-a[i]>1{
				fl=false
			}
		}
		// Fprintln(out,a)
		if fl{
			Fprintln(out,"YES")
		} else {
			Fprintln(out,"NO")
		}
	}
}

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

package main

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

func solve(a []int) bool {
	sort.Ints(a)
	for i := 1; i < len(a); i++ {
		if a[i]-a[i-1] > 1 {
			return false
		}
	}
	return true
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t, n int
	fmt.Fscan(in, &t)
	a := make([]int, 50)
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
		}
		if solve(a[: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, n int
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
		}
		sort.Ints(a)
		ans := "YES"
		for i, x := range a[1:] {
			if x-a[i] > 1 {
				ans = "NO"
				break
			}
		}
		fmt.Fprintln(out, ans)
	}
}

package main

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

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

	tc := readNum(reader)
	var buf bytes.Buffer
	for tc > 0 {
		tc--
		n := readNum(reader)
		A := readNNums(reader, n)
		if solve(n, A) {
			buf.WriteString("YES\n")
		} else {
			buf.WriteString("NO\n")
		}
	}
	fmt.Print(buf.String())
}

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(n int, A []int) bool {
	sort.Ints(A)

	for i := 1; i < n; i++ {
		if A[i]-A[i-1] > 1 {
			return false
		}
	}

	return true
}

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 i := 0; i < t; i++ {

		var n int
		fmt.Fscan(in, &n)

		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
		}

		sort.Ints(a)

		r := true
		for j := 0; j < n-1; j++ {
			if a[j+1]-a[j] > 1 {
				r = false
				break
			}
		}

		if r {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}

	}

}

package main

import (
    "fmt"
    "sort"
)

func main() {
    var t int
    fmt.Scan(&t)

    for t > 0 {
        var n int
        fmt.Scan(&n)
        a := make([]int, n)
        for i := 0; i < n; i++ {
            fmt.Scan(&a[i])
        }

        valid := true

        sort.Ints(a[:])
        for i := 0; i < n - 1; i++ {
            if a[i + 1] - a[i] > 1 {
                valid = false
            }
        }

        if valid {
            fmt.Println("YES")
        } else {
            fmt.Println("NO")
        }

        t--
    }
}

package main

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

func main() {
	io := NewFastIO(os.Stdin, os.Stdout)
	defer io.Flush()

	for t := io.NextInt(); t > 0; t-- {
		n := io.NextInt()
		a := io.NextInts(n)
		sort.Ints(a)
		ans := "YES"
		for i, x := range a[1:] {
			if x-a[i] > 1 {
				ans = "NO"
			}
		}
		io.Println(ans)
	}
}

type FastIO struct {
	*bufio.Reader
	*bufio.Writer
	c [1]byte
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{Reader: bufio.NewReader(r), Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	f.Read(f.c[:])
	return f.c[0]
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, f.c[0])
	}
	return string(s)
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f.Writer, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f.Writer, a...)
}

func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(' ', x)
		}
	}
}

func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}

package main

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

var out = bufio.NewWriter(os.Stdout)
func print(f string, args ...interface{}){
	fmt.Fprintf(out,f,args...)
}
func main(){
	defer out.Flush()
	var t,n int
	a := [55]int{}
	fmt.Scan(&t)
	for ;t>0;t--{
		fmt.Scan(&n)
		readN(a[:],0,n)
		if n==1{
			print("YES\n")
			continue
		}
		sort(a[:],0,n-1)
		var temp []int
		for i:=0;i<n-1;i++{
			temp = append(temp, a[i+1]-a[i])
		}
		sort(temp,0,len(temp)-1)
		if temp[len(temp)-1] > 1{
			print("NO\n")
		}else {
			print("YES\n")

		}
	}

}

func readN(all []int, i, n int) {
    if n == 0 {
        return
    }
    if m, err := scan(&all[i]); m != 1 {
        panic(err)
    }
    readN(all, i+1, n-1)
}

func scan(a *int) (int, error) {
    return fmt.Scan(a)
}

func merge(a []int, l, mid, h int) {
	la := make([]int, mid-l+1)
	ra := make([]int, h-mid)
	copy(la, a[l:mid+1])
	copy(ra, a[mid+1:h+1])
	var i, j int
	k := l
	for ; i < len(la) && j < len(ra); k++ {
		if la[i] < ra[j] {
			a[k] = la[i]
			i++
		} else {
			a[k] = ra[j]
			j++
		}
	}
	for ; i < len(la); i, k = i+1, k+1 {
		a[k] = la[i]
	}
	for ; j < len(ra); j, k = j+1, k+1 {
		a[k] = ra[j]
	}
}

func sort(a []int, l, h int) {
	if l >= h {
		return
	}
	mid := (l + h) / 2
	sort(a, l, mid)
	sort(a, mid+1, h)
	merge(a, l, mid, h)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var t int
	fmt.Scan(&t)
	for ; t > 0; t-- {
		var n int
		fmt.Scan(&n)

		sli := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&sli[i])
		}

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

		ok := true
		for i := 1; i < n && ok; i++ {
			if sli[i]-sli[i-1] > 1 {
				ok = false
			}
		}

		if ok {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
"fmt"
"sort"
)

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

		var n int
		var a []int
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			var x int
			fmt.Scan(&x)
			a = append(a, x)
		}
		sort.Ints(a)
		flag := true
		for i := 1; i < n; i++ {
			if a[i] - a[i - 1] > 1 {
				flag = false
				break
			}
		}

		if flag {
			fmt.Println("YES")
		} else {
		    fmt.Println("NO")
		}
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	writer = bufio.NewWriter(os.Stdout)
)

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

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

	// fmt.Println(arr)
	for i := 1; i < len(arr); i++ {
		// fmt.Println(arr[i-1], arr[i], arr[i-1]-arr[i])
		if arr[i-1]-arr[i] > 1 {
			return false
		}
	}

	return true
}

func main() {
	defer writer.Flush()

	var (
		t, n int
		arr  []int
	)

	scanf("%d\n", &t)
	for ; t > 0; t-- {
		scanf("%d\n", &n)
		arr = make([]int, n)

		for i := 0; i < n; i++ {
			scanf("%d", &arr[i])
		}
		scanf("\n")

		if solve(arr) {
			printf("YES\n")
		} else {
			printf("NO\n")
		}
	}
}

package main

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

var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)

	fmt.Fscan(input, &t)

	for o := 0; o < t; o++ {
		var n int
		fmt.Fscan(input, &n)

		arr := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(input, &arr[i])
		}

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

		ok := true
		for i := 0; i < (n - 1); i++ {
			if arr[i+1]-arr[i] > 1 {
				ok = false
				break
			}
		}

		if ok == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		var n int
		fmt.Scan(&n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Scan(&a[i])
		}
		sort.Ints(a)
		j := 0
		for j < n-1 && a[j+1]-a[j] <= 1 {
			j++
		}
		if j == n-1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		t--
	}

}

package main

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

func main() {
	var t, n int

	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		var s []int
		for j := 0; j < n; j++ {
			var inp int
			fmt.Fscan(in, &inp)
			s = append(s, inp)
		}
		var isNo bool
		sort.Ints(s)
		for i := 1; i < len(s); i++ {
			if s[i]-s[i-1] > 1 {
				isNo = true
				break
			}
		}
		if isNo {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func nxt() int {
	var x int
	fmt.Scan(&x)
	return x
}

func ok() {
	fmt.Println("YES")
}

func no() {
	fmt.Println("NO")
}

func solve() {
	n := nxt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nxt()
	}
	sort.Sort(sort.IntSlice(a))
	for i := 1; i < n; i++ {
		if a[i - 1] + 1 < a[i] {
			no()
			return
		}
	}
	ok()
}

func main() {
	var t int = nxt()
	for t > 0 {
		t--
		solve()
	}
	return
}

package main

import (
	"fmt"
	"sort"
)

func solve() {
	var massLen int
	fmt.Scan(&massLen)
	array := make([]int, massLen)
	for i := 0; i < massLen; i++ {
		fmt.Scan(&array[i])
	}
	sort.Ints(array)
	for i := 1; i < massLen; i++ {
		if array[i]-array[i-1] > 1 {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
	return
}

func main() {
	var n int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		solve()
	}
}

package main

import (
	"fmt"
	"sort"
	"strconv"
)

func checkArray(a []int) bool {
	for i:=0; i<len(a)-1; i++ {
		if a[i+1]-a[i]>1 {
			return false
		}
	}
	return true
}

func main() {
	var n, t int
	var s string
	fmt.Scan(&t)

	for k:=0; k<t; k++ {
		fmt.Scan(&n)

		var a []int
		for p:=0; p<n; p++ {
			fmt.Scan(&s)
			m, _ := strconv.Atoi(s)
			a = append(a, m)
		}

		sort.Sort(sort.IntSlice(a))

		if checkArray(a) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func solver(arr []int) bool {
	if len(arr) < 2 {
		return true
	}
	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})
	prev := arr[0]
	for _, v := range arr {
		if v-prev > 1 {
			return false
		}
		prev = v
	}
	return true
}

func main() {
	defer writer.Flush()
	var testCaseNum int
	fmt.Fscanf(reader, "%d\n", &testCaseNum)

	var arrSize int
	var text string
	var split []string
	for i := 0; i < testCaseNum; i++ {
		fmt.Fscanf(reader, "%d\n", &arrSize)
		text, _ = reader.ReadString('\n')
		split = strings.Fields(text)
		arr := make([]int, len(split))
		for i, v := range split {
			arr[i], _ = strconv.Atoi(v)
		}
		if solver(arr) {
			fmt.Fprintf(writer, "YES\n")
		} else {
			fmt.Fprintf(writer, "NO\n")
		}
	}
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	//予備
	t := iScan()
	for i := 0; i < t; i++ {
		n := iScan()
		flag := true
		a := make([]int, n)
		for j := 0; j < n; j++ {
			a[j] = iScan()
		}
		sort.Slice(a, func(i int, j int) bool {
			return a[i] < a[j]
		})
		for i := 0; i < len(a)-1; i++ {
			if math.Abs(float64(a[i]-a[i+1])) > 1 {
				flag = false
				break
			}
		}
		if flag {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	//予備
	t := iScan()
	for i := 0; i < t; i++ {
		n := iScan()
		flag := 0
		a := make([]int, n)
		for j := 0; j < n; j++ {
			a[j] = iScan()
		}
		sort.Slice(a, func(i int, j int) bool {
			return a[i] < a[j]
		})
		for i := 0; i < len(a)-1; i++ {
			if a[i] == -1 {
				continue
			}
			if a[i] == a[i+1] {
				a[i] = -1
			} else if math.Abs(float64(a[i]-a[i+1])) <= 1 {
				a[i] = -1
			}
		}
		for i := 0; i < len(a); i++ {
			if a[i] != -1 {
				flag++
			}
		}
		if flag <= 1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

//Task -
type Task struct {
	Values []int
}

func (t *Task) Solve() string {
	if len(t.Values) == 1 {
		return "YES"
	}
	answer := "YES"
	sort.Ints(t.Values)
	for i := range t.Values {
		if i == 0 {
			continue
		}
		if t.Values[i]-t.Values[i-1] > 1 {
			answer = "NO"
			break
		}
	}
	return answer
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	counter := 0
	// tasksAmount := 0
	tasks := []Task{}

	for scanner.Scan() {
		if counter == 0 {
			_, _ = strconv.Atoi(scanner.Text())
		} else {
			if counter%2 == 1 {
				//Инициируем новое задание
				_ = scanner.Text()
			}
			if counter%2 == 0 {
				var currentTask Task
				//Заполняем новое задание
				currentTask = Task{
					Values: []int{},
				}
				text := scanner.Text()
				for _, i := range strings.Split(text, " ") {
					a, _ := strconv.Atoi(i)
					currentTask.Values = append(currentTask.Values, a)
				}
				tasks = append(tasks, currentTask)
			}

		}
		counter++
	}

	for _, t := range tasks {
		fmt.Println(t.Solve())
	}
}

package main

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

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

	var tries int
	fmt.Fscan(in, &tries)

	for i := 0; i < tries; i++ {
		var count int
		fmt.Fscan(in, &count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			fmt.Fscan(in, &adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count-1; k++ {
			if adads[k+1]-adads[k] >= 2 {
				flag = true
				break
			}
		}

		if flag {
			fmt.Fprintln(out, "NO")
		} else {
			_, _ = fmt.Fprintln(out, "YES")
		}
	}
}

package main

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

// https://codeforces.com/problemset/problem/1399/A
// A. Remove Smallest
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// You are given the array a
// consisting of n

// positive (greater than zero) integers.

// In one move, you can choose two indices i
// and j (i≠j) such that the absolute difference between ai and aj is no more than one (|ai−aj|≤1

// ) and remove the smallest of these two elements. If two elements are equal, you can remove any of them (but exactly one).

// Your task is to find if it is possible to obtain the array consisting of only one element using several (possibly, zero) such moves or not.

// You have to answer t

// independent test cases.
// Input

// The first line of the input contains one integer t
// (1≤t≤1000) — the number of test cases. Then t

// test cases follow.

// The first line of the test case contains one integer n
// (1≤n≤50) — the length of a. The second line of the test case contains n integers a1,a2,…,an (1≤ai≤100), where ai is the i-th element of a

// .
// Output

// For each test case, print the answer: "YES" if it is possible to obtain the array consisting of only one element using several (possibly, zero) moves described in the problem statement, or "NO" otherwise.

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

	var t int
	_, _ = fmt.Fscan(bufStdin, &t)

	tests := make([][]int, t)
	for i := 0; i < t; i++ {
		var n int
		_, _ = fmt.Fscan(bufStdin, &n)

		tests[i] = make([]int, n)
		for j := 0; j < n; j++ {
			_, _ = fmt.Fscan(bufStdin, &tests[i][j])
		}
	}

	for _, test := range tests {
		if canReduceTo1Elem(test) {
			_, _ = fmt.Println("YES")
		} else {
			_, _ = fmt.Println("NO")
		}

	}
}

func canReduceTo1Elem(nums []int) bool {
	sort.Ints(nums)

	for i := 0; i < len(nums)-1; i++ {
		if nums[i+1]-nums[i] > 1 {
			return false
		}
	}

	return true
}

package main
import (
    "bufio"
    "fmt"
    "os"
    "sort"
)
func main(){
    r := bufio.NewReader(os.Stdin)
    w := bufio.NewWriter(os.Stdout)
    defer w.Flush()

    var t int
    fmt.Fscan(r, &t)
    for i := 0; i < t; i++ {
        var n int
        fmt.Fscan(r, &n)
        a := make([]int, n)
        for j := 0; j < n; j++{
            fmt.Fscan(r, &a[j])
        }
        sort.Ints(a)
        flag := true
        for j := 1; j < n; j++ {
            if a[j] - a[j-1] > 1 {
                flag = false
                break
            }
        }
        if flag {
            fmt.Fprintln(w, "YES")
        } else {
            fmt.Fprintln(w, "NO")
        }
    }
}

package main

import (
	"fmt"
	"sort"
)

type test struct {
	a []int
}

const TEST_MAX_SIZE = 50

func is_editable(a []int) bool {
	sort.Ints(a)
	for i := 1; i < len(a); i += 1 {
		if a[i]-a[i-1] > 1 {
			return false
		}
	}
	return true
}

// https://codeforces.com/problemset/problem/1399/A
// комментарий к решению
// Т.к. от нас не требуется выводить результирующий элемент массива,
// то достаточно проверить, что из массива можно сделать неубывающий
// массив с разницей соседних любых двух элементов <= 1
func taskSolution(in []test) string {
	ans := make([]byte, 0, len(in)*4) //YES\n == 4 byte
	for i := 0; i < len(in); i += 1 {
		if is_editable(in[i].a) {
			ans = append(ans, []byte("YES\n")...)
		} else {
			ans = append(ans, []byte("NO\n")...)
		}
	}
	return string(ans[:len(ans)-1])
}

func main() {
	var t int
	if _, err := fmt.Scan(&t); err != nil {
		panic(err)
	}

	in := make([]test, 0, t)
	for i := 0; i < t; i += 1 {
		var n, ai int
		a := make([]int, 0, TEST_MAX_SIZE)
		if _, err := fmt.Scan(&n); err != nil {
			panic(err)
		}
		for j := 0; j < n; j += 1 {
			if _, err := fmt.Scan(&ai); err != nil {
				panic(err)
			}
			a = append(a, ai)
		}
		in = append(in, test{a})
	}

	fmt.Println(taskSolution(in))
}

package main

import (
	"fmt";
"sort"
)

func main() {
	var t int64
	fmt.Scan(&t)
	for t > 0 {
		var n int
		fmt.Scan(&n)
		a := make([]int, n)
		for i:=0;i<n;i++ {
			fmt.Scan(&a[i])
		}
		sort.Ints(a)
		j := 0
		for j<n-1 && a[j+1]-a[j]<=1 {
			j++
		}
		if j==n-1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		t--
	}
}

package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

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

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

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

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

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

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

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

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

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

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

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

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

func sol(a []int64) string {
	sort.Slice(a, func(idx1, idx2 int) bool {
		return a[idx1] < a[idx2]
	})
	prev := a[0]
	for i := 1; i < len(a); i++ {
		if a[i]-prev > 1 {
			return "NO"
		}
		prev = a[i]
	}
	return "YES"
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"sync"
)
var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup
func GetNum(p string)int64{
	var ans int64 = 0
	flag:=true
	i:=0
	n:=len(p)
	if p[i]=='-'{
		flag=false
		i++
	}
	for ;i<n;i++{
		ans=(ans<<1)+(ans<<3)+int64(p[i]-'0')
	}
	if !flag{
		ans=-ans
	}
	return ans
}
func ReadString() string {
	in.Scan()
	return in.Text()
}
func ReadStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ReadString()
	}
	return s
}
func ReadInt() int {
	intStr := ReadString()
	return int(GetNum(intStr))
}
func ReadIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ReadInt()
	}
	return arr
}
func ReadInt64() int64 {
	int64Str:=ReadString()
	return GetNum(int64Str)
}
func ReadInt64Slice(n int)[] int64{
	arr:=make([]int64,n)
	for i:=0;i<n;i++{
		arr[i] = ReadInt64()
	}
	return arr
}

func init() {

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1<<10), int(2e+5))
	in.Split(bufio.ScanWords)

	out = make(chan string, 1<<4)
	outWg = &sync.WaitGroup{}
	outWg.Add(1)
	writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
	go func(write *bufio.Writer) {
		defer outWg.Done()
		defer write.Flush()
		for line := range out {
			write.WriteString(line + "\n")
		}
	}(writer)
}
func work(){
	n:=ReadInt()
	a:=ReadIntSlice(n)
	sort.Ints(a)
	f:=true
	for i:=1;i<len(a);i++{
		if a[i]-a[i-1] >1{
			fmt.Println("NO")
			f=false
		}
	}
	if f{
		fmt.Println("YES")
	}
}

func main(){
	for t:=ReadInt();t>0;t--{
		work()
	}
	close(out)
}

package main

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

func main() {
	var t, n, a, la int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		ans := "YES"
		fmt.Fscan(in, &n, &la)
		for j := 1; j < n; j++ {
			fmt.Fscan(in, &a)
			if abs(a-la) > 1 {
				ans = "NO"
			}
			la = a
		}
		fmt.Println(ans)
	}

}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

package main

import "fmt"

func main() {
	var tn int
	fmt.Scan(&tn)
	for i := 0; i < tn; i++ {
		var tsSize int
		fmt.Scan(&tsSize)
		var ts []int
		for i := 0; i < tsSize; i++ {
			var item int
			fmt.Scan(&item)
			ts = append(ts, item)
		}
		for i := 0; i < tsSize; i++ {
			for j := i+1; j < tsSize;  {
				var dif = ts[i] - ts[j]
				if dif == 1 || dif == 0 {
					ts[j] = ts[len(ts)-1]
					tsSize--
				} else if dif == -1 {
					ts[i] = ts[len(ts)-1]
					tsSize--
				} else {
					j++
				}
			}
		}
		if tsSize == 1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

const MaxN int = 50 + 5

var read *bufio.Reader = bufio.NewReader(os.Stdin)
var write *bufio.Writer = bufio.NewWriter(os.Stdout)
var num [MaxN]int

func quickSort(arr [MaxN]int, left int, right int) {
	if left < right {
		partitionIndex := partition(arr, left, right)
		quickSort(arr, left, partitionIndex-1)
		quickSort(arr, partitionIndex+1, right)
	}
}

func partition(arr [MaxN]int, left int, right int) int {
	var res = left + 1
	for i := res; i <= right; i++ {
		if arr[i] < arr[left] {
			swap(arr, i, res)
			res += 1
		}
	}
	swap(arr, res, res-1)
	return res - 1
}

func swap(arr [MaxN]int, i int, j int) {
	arr[i], arr[j] = arr[j], arr[i]
}

func abs(x int) int {
	if x < 0 {
		return -x
	} else {
		return x
	}
}

func main() {
	defer write.Flush()
	var t int
	fmt.Fscan(read, &t)
	for ; t > 0; t-- {
		var n int
		fmt.Fscan(read, &n)
		for i := 0; i < n; i++ {
			fmt.Fscan(read, &num[i])
		}
		quickSort(num, 0, n-1)
		var flag bool = true
		for i := 1; i < n; i++ {
			if abs(num[i]-num[i-1]) > 1 {
				flag = false
				break
			}
		}
		if flag {
			fmt.Fprintln(write, "YES")
		} else {
			fmt.Fprintln(write, "NO")
		}
	}
}

package main

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

func main() {

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

	var t int
	fmt.Fscan(in, &t)

	for i := 0; i < t; i++ {

		var n int
		fmt.Fscan(in, &n)

		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
		}

		r := true
		for l := 1; l < n; l++ {
			diff := a[0] - a[l]
			if diff < 0 {
				diff *= -1
			}
			if diff > 1 {
				r = false
				break
			}
		}

		if r {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}

	}

}

package main

import (
"fmt"
"sort"
)

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

		var n int
		var a []int
		for i := 0; i < n; i++ {
			var x int
			fmt.Scan(&x)
			a = append(a, x)
		}
		sort.Ints(a)
		flag := true
		for i := 0; i < n; i++ {
			if a[i + 1] - a[i] > 1 {
				flag = false
				break
			}
		}

		if flag {
			fmt.Println("Yes")
		} else {
		    fmt.Println("No")
		}
	}
}

package main

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

func main() {
	var t, n int

	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		var s []int
		for j := 0; j < n; j++ {
			var inp int
			fmt.Fscan(in, &inp)
			s = append(s, inp)
		}
		var isNo bool
		for i := 1; i < len(s); i++ {
			if s[i]-s[i-1] > 1 {
				isNo = true
				break
			}
		}
		if isNo {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func main() {
	var n, t, inp uint16
	var s []uint16
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d\n", &n)
	for i := uint16(0); i < n; i++ {
		fmt.Fscanf(in, "%d\n", &t)
		for j := uint16(0); j < t; j++ {
			if t-1 == j {
				fmt.Fscanf(in, "%d\n", &inp)
				s = append(s, inp)
			} else {
				fmt.Fscanf(in, "%d", &inp)
				s = append(s, inp)
			}
		}

		if check(s) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		s = nil
	}
}
func check(s []uint16) bool {
	for k := 0; k < len(s)-1; k++ {
		if uint16(math.Abs(float64(s[k])-float64(s[k+1]))) > 1 {
			return false
		}
	}
	return true
}

package main

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

func main() {
	var t, n int

	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		var s []int
		for j := 0; j < n; j++ {
			var inp int
			fmt.Fscan(in, &inp)
			s = append(s, inp)
		}
		for i := 1; i < len(s); i++ {
			if s[i]-s[i-1] > 1 {
				fmt.Println("NO")
			}
		}
		fmt.Println("YES")
	}
}

package main

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

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		var thisisNo bool = false
		var perv int
		for j := 0; j < n; j++ {
			var inp int
			fmt.Fscan(in, &inp)
			if perv != 0 {
				if int(math.Abs(float64(perv-inp))) > 1 {
					thisisNo = true
					//break
				}
			}
			perv = inp
		}
		if thisisNo == true {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

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

func main() {
	var n, t, inp uint16
	var s []uint16
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d\n", &n)
	for i := uint16(0); i < n; i++ {
		fmt.Fscanf(in, "%d\n", &t)
		for j := uint16(0); j < t-1; j++ {
			fmt.Fscanf(in, "%d", &inp)
			s = append(s, inp)
		}
		fmt.Fscanf(in, "%d\n", &inp)
		s = append(s, inp)
		if check(s) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		s = nil
	}
}
func check(s []uint16) bool {
	for k := 0; k < len(s)-1; k++ {
		if uint16(math.Abs(float64(s[k])-float64(s[k+1]))) > 1 {
			return false
		}
	}
	return true
}

package main

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

func main() {
	var t, n int

	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		var s []int
		for j := 0; j < n; j++ {
			var inp int
			fmt.Fscan(in, &inp)
			s = append(s, inp)
		}
		var isNo bool
		for i := 1; i < len(s); i++ {
			if int(math.Abs(float64(s[i]-s[i-1]))) > 1 {
				isNo = true
				break
			}
		}
		if isNo {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func nxt() int {
	var x int
	fmt.Scan(&x)
	return x
}

func ok() {
	println("YES")
}

func no() {
	println("NO")
}

func solve() {
	n := nxt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nxt()
	}
	sort.Sort(sort.IntSlice(a))
	for i := 1; i < n; i++ {
		if a[i - 1] + 1 < a[i] {
			no()
			return
		}
	}
	ok()
}

func main() {
	var t int = nxt()
	for t > 0 {
		t--
		solve()
	}
	return
}

package main

import (
	"fmt"
	"sort"
)

func solve() {
	var massLen int
	fmt.Scanf("%d\n", &massLen)
	array := make([]int, massLen)
	for i := 0; i < massLen; i++ {
		fmt.Scanf("%d", &array[i])
	}
	sort.Ints(array)
	for i := 1; i < massLen; i++ {
		if array[i]-array[i-1] > 1 {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
	return
}

func main() {
	var n int
	fmt.Scanf("%d\n", &n)

	for i := 0; i < n; i++ {
		solve()
	}
}

package main

import (
	"fmt"
	"strconv"
)

func checkArray(a []int) bool {
	for i:=0; i<len(a)-1; i++ {
		for j:=0; j<len(a); j++ {
			if a[j]-a[i]>1 {
				return false
			}
		}
	}
	return true
}

func main() {
	var n, t int
	var s string
	fmt.Scan(&t)

	for k:=0; k<t; k++ {
		fmt.Scan(&n)

		var a []int
		for p:=0; p<n; p++ {
			fmt.Scan(&s)
			m, _ := strconv.Atoi(s)
			a = append(a, m)
		}

		if checkArray(a) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"sort"
	"strconv"
)

func checkArray(a []int) bool {
	for i:=0; i<len(a)-1; i++ {
		for j:=i+1; j<len(a); j++ {
			if a[j]-a[i]>1 {
				return false
			}
		}
	}
	return true
}

func main() {
	var n, t int
	var s string
	fmt.Scan(&t)

	for k:=0; k<t; k++ {
		fmt.Scan(&n)

		var a []int
		for p:=0; p<n; p++ {
			fmt.Scan(&s)
			m, _ := strconv.Atoi(s)
			a = append(a, m)
		}

		sort.Ints(a)

		if checkArray(a) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"sort"
	"strconv"
)

func checkArray(a []int) bool {
	for i:=0; i<len(a)-1; i++ {
		for j:=i+1; j<len(a); j++ {
			if a[j]-a[i]>1 {
				return false
			}
		}
	}
	return true
}

func main() {
	var n, t int
	var s string
	fmt.Scan(&t)

	for k:=0; k<t; k++ {
		fmt.Scan(&n)

		var a []int
		for p:=0; p<n; p++ {
			fmt.Scan(&s)
			m, _ := strconv.Atoi(s)
			a = append(a, m)
		}

		sort.Sort(sort.IntSlice(a))

		if checkArray(a) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func solver(arr []int) bool {
	if len(arr) < 2 {
		return true
	}
	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})
	prev := arr[0]
	for _, v := range arr {
		if v-prev > 1 {
			return false
		}
		prev = v
	}
	return true
}

func main() {
	defer writer.Flush()
	arr := []int{1, 2, 3, 4, 5, 6, 7, 4}
	if solver(arr) {
		fmt.Fprintf(writer, "YES\n")
	} else {
		fmt.Fprintf(writer, "NO\n")
	}
}

func temp() {
	defer writer.Flush()
	var testCaseNum int
	fmt.Fscanf(reader, "%d\n", &testCaseNum)

	var arrSize int
	var text string
	var split []string
	for i := 0; i < testCaseNum; i++ {
		fmt.Fscanf(reader, "%d\n", &arrSize)
		text, _ = reader.ReadString('\n')
		split = strings.Fields(text)
		arr := make([]int, len(split))
		for i, v := range split {
			arr[i], _ = strconv.Atoi(v)
		}
		if solver(arr) {
			fmt.Fprintf(writer, "YES\n")
		} else {
			fmt.Fprintf(writer, "NO\n")
		}
	}
}

package main

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

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func solver(arr []int) bool {
	if len(arr) < 2 {
		return true
	}
	sort.Slice(arr, func(i, j int) bool {
		return arr[i] < arr[j]
	})
	prev := arr[0]
	for _, v := range arr {
		if v-prev > 1 {
			return false
		}
	}
	return true
}

func main() {
	defer writer.Flush()
	var testCaseNum int
	fmt.Fscanf(reader, "%d\n", &testCaseNum)

	var arrSize int
	var text string
	var split []string
	for i := 0; i < testCaseNum; i++ {
		fmt.Fscanf(reader, "%d\n", &arrSize)
		text, _ = reader.ReadString('\n')
		split = strings.Fields(text)
		arr := make([]int, arrSize)
		for i, v := range split {
			arr[i], _ = strconv.Atoi(v)
		}
		if solver(arr) {
			fmt.Fprintf(writer, "YES\n")
		} else {
			fmt.Fprintf(writer, "NO\n")
		}
	}
}

package main

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

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

	var tries int
	fmt.Fscan(in, &tries)

	for i := 0; i < tries; i++ {
		var count int
		fmt.Fscan(in, &count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			fmt.Fscan(in, &adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count-1; k++ {
			if adads[k+1]-adads[k] >= 2 {
				flag = true
				break
			}
		}

		if flag {
			fmt.Fprintln(out, "NO")
		} else {
			fmt.Fprintln(out, "YES")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var tries int
	_, _ = fmt.Scan(&tries)

	for i := 0; i < tries; i++ {
		var count int
		_, _ = fmt.Scan(&count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			_, _ = fmt.Scanf("%d", &adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count; k++ {
			if k+1 < count {
				if adads[k+1]-adads[k] >= 2 {
					println("NO")
					flag = true
					break
				}
			}
		}

		if !flag {
			fmt.Println("YES")
		}
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var tries int
	_, _ = fmt.Scan(&tries)
	answers := make([]string, tries)

	for i := 0; i < tries; i++ {
		var count int
		_, _ = fmt.Scan(&count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			_, _ = fmt.Scanf("%d", &adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count; k++ {
			if k+1 < count {
				if adads[k+1]-adads[k] >= 2 {
					answers[i]="NO"
					flag = true
					break
				}
			}
		}

		if !flag {
			answers[i]="YES"
		}
	}

	for j := 0; j < tries; j++ {
		println(answers[j])
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var tries int
	_, _ = fmt.Scan(&tries)

	for i := 0; i < tries; i++ {
		var count int
		_, _ = fmt.Scan(&count)
		adads := make([]int, count)

		for j := 0; j < count; j++ {
			_, _ = fmt.Scan(&adads[j])
		}

		sort.Ints(adads)
		flag := false
		for k := 0; k < count-1; k++ {
			if adads[k+1]-adads[k] >= 2 {
				println("NO")
				flag = true
				break
			}
		}

		if !flag {
			fmt.Println("YES")
		}
	}
}


package main

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

func main() {
	s := bufio.NewScanner(os.Stdin)
	s.Scan()
	n, _ := strconv.Atoi(s.Text())

	var input []*pair
	for i := 0; i < n; i++ {
		s.Scan()
		line := s.Text()
		tokens := strings.Split(line, " ")
		a, _ := strconv.Atoi(tokens[1])
		input = append(input, &pair{tokens[0], a})
	}

	output := findOrder(input)
	if output == nil {
		fmt.Println(-1)
		return
	}

	for _, o := range output {
		fmt.Println(o.key, o.value)
	}
}

type pair struct {
	key   string
	value int
}

func findOrder(input []*pair) []*pair {
	// Sort the input by their a values. This will be the ordering in the queue.
	sort.Slice(input, lessPair(input))
	index := make(map[string]*pair)

	// Keep the height ordering in this separate slice.
	// The earlier the name appears in the slice, the taller.
	h := make([]string, 0, len(input))

	for _, p := range input {
		if p.value > len(h) {
			return nil
		}

		index[p.key] = p

		// Insert this person at the i-th position in the height ordering.
		h = append(h[:p.value], append([]string{p.key}, h[p.value:]...)...)
	}

	// Determine all the people's heights.
	tallest := len(h)
	for i, name := range h {
		index[name].value = tallest - i
	}

	return input
}

func lessPair(p []*pair) func(i, j int) bool {
	return func(i, j int) bool {
		return p[i].value < p[j].value
	}
}

// Codeforces 141 C not done XXX
package main

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

// Man no women because of misogynism.
type Man struct {
    name string
    h int       // height
    hb int      // higher before
}
// Men array of Man for sorting sorting.
type Men []Man

func (slice Men) Len() int {
	return len(slice)
}
func (slice Men) Less(i, j int) bool {
	return slice[i].hb < slice[j].hb;
}
func (slice Men) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

var a Men

func main() {
    // reading n
    var n int
    in    := bufio.NewReader(os.Stdin)
    s,err := in.ReadString('\n')
    if err != nil {
        fmt.Println("first read failure", err)
    }
    ss := strings.Split(strings.Trim(s," \n\r")," ")
    n,err = strconv.Atoi(ss[0])
    a = Men(make([]Man,n))
    for i:=0; i<n; i++ {
        s,err := in.ReadString('\n')
        if err != nil {
            fmt.Println("first read failure", err)
        }
        ss = strings.Split(strings.Trim(s," \n\r")," ")
        var m Man
        m.name = ss[0]
        m.h = 0
        m.hb,err = strconv.Atoi(ss[1])
        a[i] = m
    }
    sort.Sort(a)

    // setting h
    for i:=0; i<n; i++ {
        a[i].h = i+1 - a[i].hb
        if a[i].h<=0 {
            fmt.Println(-1)
            return
        }
        for j:=0; j<i; j++ {
            if a[j].h>=a[i].h {
                a[j].h++
            }
        }
    }

	// print result
    for i:=0; i<n; i++ {
        fmt.Printf("%s %d\n", a[i].name, a[i].h)
    }
}

// Codeforces 635 E, with podskazki, done
package main

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

// Man no women because of misogynism.
type Man struct {
    name string
    h int       // height
    hb int      // higher before
}
// Men array of Man for sorting sorting.
type Men []Man

func (slice Men) Len() int {
	return len(slice)
}
func (slice Men) Less(i, j int) bool {
	return slice[i].hb < slice[j].hb;
}
func (slice Men) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

var a Men

func main() {
    // reading n
    var n int
    in    := bufio.NewReader(os.Stdin)
    s,err := in.ReadString('\n')
    if err != nil {
        fmt.Println("first read failure", err)
    }
    ss := strings.Split(strings.Trim(s," \n\r")," ")
    n,err = strconv.Atoi(ss[0])
    a = Men(make([]Man,n))
    for i:=0; i<n; i++ {
        s,err := in.ReadString('\n')
        if err != nil {
            fmt.Println("first read failure", err)
        }
        ss = strings.Split(strings.Trim(s," \n\r")," ")
        var m Man
        m.name = ss[0]
        m.h = 0
        m.hb,err = strconv.Atoi(ss[1])
        a[i] = m
    }
    sort.Sort(a)

    // setting h
    for i:=0; i<n; i++ {
        j := 0
        cnt := a[i].hb
        for j=i-1; j>=0 && cnt>0; j-- {
            a[j].h++
            cnt--
        }
        if cnt>0 {
            fmt.Println(-1)
            return
        }
        a[i].h = j+1
    }

	// print result
    for i:=0; i<n; i++ {
        fmt.Printf("%s %d\n", a[i].name, a[i].h)
    }
}

// Codeforces 635 E, with podskazki, done
package main

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

// Man no women because of misogynism.
type Man struct {
    name string
    h int       // height
    hb int      // higher before
}
// Men array of Man for sorting sorting.
type Men []Man

func (slice Men) Len() int {
	return len(slice)
}
func (slice Men) Less(i, j int) bool {
	return slice[i].hb < slice[j].hb;
}
func (slice Men) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

var a Men

func main() {
    // reading n
    var n int
    in    := bufio.NewReader(os.Stdin)
    s,err := in.ReadString('\n')
    if err != nil {
        fmt.Println("first read failure", err)
    }
    ss := strings.Split(strings.Trim(s," \n\r")," ")
    n,err = strconv.Atoi(ss[0])
    a = Men(make([]Man,n))
    for i:=0; i<n; i++ {
        s,err := in.ReadString('\n')
        if err != nil {
            fmt.Println("first read failure", err)
        }
        ss = strings.Split(strings.Trim(s," \n\r")," ")
        var m Man
        m.name = ss[0]
        m.h = 0
        m.hb,err = strconv.Atoi(ss[1])
        a[i] = m
    }
    sort.Sort(a)

    // setting h
    for i:=0; i<n; i++ {
        j := 0
        cnt := a[i].hb
        for j=i-1; j>=0 && cnt>0; j-- {
            a[j].h++
            cnt--
        }
        if cnt>0 {
            fmt.Println(-1)
            return
        }
        a[i].h = j+2
    }

	// print result
    for i:=0; i<n; i++ {
        fmt.Printf("%s %d\n", a[i].name, a[i].h)
    }
}


package main

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

var scanner *bufio.Scanner

func init_scanner() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024*1024*20
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
}

func readInt() int {
	scanner.Scan()
	val, _ := strconv.Atoi(scanner.Text())
	return val
}

func main() {
	init_scanner()
	n := readInt()
	a, b := 0, 0
	for i := 0; i < n; i++ {
		x, _ := readInt(), readInt()
		if x < 0 {
			a++
		} else {
			b++
		}
	}

	if a <= 1 || b <= 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

// Codeforces helper functions
// 20 Jan 18
// samadhi

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	//fmt.Println("Hello, world!")

	n := gsli(reader)[0]

	neg := 0
	pos := 0

	for i := 0; i < n; i++ {
		cur := gsli(reader)
		if cur[0] > 0 {
			pos += 1
		} else {
			neg += 1
		}
	}

	if neg <= 1 || pos <= 1 {
		fmt.Printf("Yes")
		return
	} else {
		fmt.Printf("No")
	}

	//fmt.Printf("%#v", points)

}

// Input helpers

// If you don't pass in a reference to the reader, and just instantiate a new
// one every time, it will work locally, with IO typed at human-speed, but not
// on Codeforces.

// Get Space-separated Line as Strings
//
// Example input:
// 1 test 382.0
// Example output:
// ["1", "test", "382.0"]

func gsls(reader *bufio.Reader) (arr []string) {
	// Get a full line
	input, _ := reader.ReadString('\n')

	//Strip newline and return chars, if any
	input = strings.TrimSuffix(input, "\n")
	input = strings.TrimSuffix(input, "\r")

	// Split at the spaces into an array
	arr = strings.Split(input, " ")

	return
}

// Get Space-separated Line as Integers
// Any non-valid integers will be 0
//
// Example input:
// test 1 12.3 -117
// Example output:
// [0, 1, 0, -117]

func gsli(reader *bufio.Reader) (arr []int) {
	stringArr := gsls(reader)

	for _, e := range stringArr {
		cur, _ := strconv.Atoi(e)
		arr = append(arr, cur)
	}

	return
}

// Get Space-separated Line as 64-bit Floats
// Any non-valid floats will be 0
//
// Example input:
// test 128.328 12 -11.0
// Example output:
// [0, 128.328, 12, -11]

func gslf(reader *bufio.Reader) (arr []float64) {
	stringArr := gsls(reader)

	for _, e := range stringArr {
		cur, _ := strconv.ParseFloat(e, 64)
		arr = append(arr, cur)
	}

	return
}

// Math helpers

// Positve Modulo
// Returns x mod y, but always positive

func posMod(x, y int) int {
	return (x%y + y) % y
}

package main

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

func solve() {
	n := readInt()
	cnt0 := 0
	cnt1 := 0
	for i := 0; i < n; i++ {
		x := readInt()
		readInt()
		if x > 0 {
			cnt0++
		} else {
			cnt1++
		}
	}
	if cnt0 <= 1 || cnt1 <= 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

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

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

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

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

package main

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

var inf int = 0x3f3f3f3f
var reader *bufio.Reader

func init() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader = bufio.NewReaderSize(stdin, 1<<20)
}

var n int

func main() {
	fmt.Fscan(reader, &n)
	var l, r int
	for ; n != 0; n-- {
		var x, y int
		fmt.Fscan(reader, &x, &y)
		if x <= 0 {
			l++
		} else {
			r++
		}
	}
	if l <= 1 || r <= 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

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

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte.  Trailing '\n' will not be included.
// See also comments on readb()
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Utilities

func sumSlice(a []int) int {
	var res int
	for _, v := range a {
		res += v
	}
	return res
}

func sumSlicell(a []int64) int64 {
	var res int64
	for _, v := range a {
		res += v
	}
	return res
}

func readInts(N int) (int, []int) {
	if N == 0 {
		N = readi()
	}
	a := make([]int, N)
	for i := range a {
		a[i] = readi()
	}
	return N, a
}

func readIntsll(N int) (int, []int64) {
	if N == 0 {
		N = readi()
	}
	a := make([]int64, N)
	for i := range a {
		a[i] = readll()
	}
	return N, a
}

// reverse slice in place
func reverse(a []int) {
	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
		a[i], a[j] = a[j], a[i]
	}
}

// areverse: allocating reverse
func areverse(a []int) []int {
	b := make([]int, len(a))
	for i := range a {
		b[i] = a[len(a)-i-1]
	}
	return b
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

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

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

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

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	n := readi()
	var pos, neg int
	for i := 0; i < n; i++ {
		x := readi()
		_ = readi()
		if x < 0 {
			neg++
		} else {
			pos++
		}
	}

	if neg < 2 || pos < 2 {
		println("Yes")
	} else {
		println("No")
	}
}

package main

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

func readInt64(scanner *bufio.Scanner) int64 {
	scanner.Scan()
	value, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return value
}

func main() {
	var n int
	var c int
	var a int64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	for i := 0; i < n; i++ {
		a = readInt64(scanner)
		_ = readInt64(scanner)
		if a > 0 {
			c++
		}
	}

	if c < 2 || n-c < 2 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	A := []int{0, 0}
	for i := 0; i < N; i++ {
		a, _ := sc.NextInt(), sc.NextInt()
		if a < 0 {
			A[0]++
		} else {
			A[1]++
		}
	}
	sort.Ints(A)
	if A[0] <= 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

func solve() {
	n := readInt()
	nleft := 0
	nright := 0
	for i := 0; i < n; i++ {
		x := readInt()
		_ = readInt()
		if x < 0 {
			nleft++
		} else if x > 0 {
			nright++
		}
	}

	if nleft == 1 || nleft == 0 || nright == 0 || nright == 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

func main() {
	var n int
	var left, right int
	bs, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err.Error())
	}
	file := bytes.NewReader(bs)
	fmt.Fscan(file, &n)
	for i := 0; i < n; i++ {
		var a, b int
		n, err := fmt.Fscan(file, &a, &b)
		if n != 2 {
			panic("n!=2")
		} else if err != nil {
			panic(err.Error())
		}
		if a > 0 {
			right++
		} else {
			left++
		}
	}
	if right <= 1 || left <= 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

import (
	"fmt"
)

func main() {
	/*file, err := os.Open("stdin.txt")
	if err != nil {
		panic(err.Error())
	}*/
	var n int
	var left, right int
	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		var a, b int
		fmt.Scanf("%d%d", &a, &b)
		if a > 0 {
			right++
		} else {
			left++
		}
	}
	if right <= 1 || left <= 1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

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

func readInt64(scanner *bufio.Scanner) int64 {
	scanner.Scan()
	value, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return value
}

func main() {
	var n int
	var c int
	var a int64

	fmt.Scan(&n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	for i := 0; i < n; i++ {
		a = readInt64(scanner)
		_ = readInt64(scanner)
		if a > 0 {
			c++
		}
	}

	fmt.Println(c)
	if c < 2 || n-c < 2 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}