using System;
using System.Collections.Generic;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int tests;
            tests = Convert.ToInt32(Console.ReadLine());
            while(Convert.ToBoolean(tests--))
            {
                int n = Convert.ToInt32(Console.ReadLine());
                List<int> lst = new List<int>();
                foreach(var element in Console.ReadLine().Split())
                {
                    lst.Add(Convert.ToInt32(element));
                }
                lst.Sort();
                bool find = false;
                int index_i = 1;
                int index_j = -1;
                while(lst.Count != 1)
                {
                    find = false;
                    for(int i = 0; i < lst.Count; i++)
                    {
                        for(int j = 0; j < lst.Count; j++)
                        {
                            if(i != j && Math.Abs(lst[i] - lst[j]) <= 1)
                            {
                                find = true;
                                index_i = i;
                                index_j = j;
                                break;
                            }
                        }
                        if(find)
                        {
                            if(lst[index_i] < lst[index_j])
                            {
                                lst.RemoveAt(index_i);
                            }
                            else
                            {
                                lst.RemoveAt(index_j);
                            }
                            break;
                        }
                    }
                    if (!find)
                    { break; }
                }
                if(lst.Count == 1)
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
        }
    }
}


using System;

class Solution
{
    static void Main(string[] args)
    {
        int t = int.Parse(Console.ReadLine());
        int[] n = new int[t];
        int[][] a = new int[t][];
        for (int i = 0; i < t; i++)
        {
            n[i] = int.Parse(Console.ReadLine());
            a[i] = Array.ConvertAll(Console.ReadLine().Split(' '), x=>int.Parse(x));
        }
        for (int i = 0; i < t; i++)
        {
            var arr = a[i];
            if (arr.Length == 1)
            {
                Console.WriteLine("YES");
                continue;
            }
            Array.Sort(arr);
            for (int j = 0; j < arr.Length-1; j++)
            {
                if (Math.Abs(arr[j] - arr[j + 1]) <= 1)
                {
                    if (j == arr.Length - 2)
                        Console.WriteLine("YES");
                    continue;
                }
                else
                {
                    Console.WriteLine("NO");
                    break;
                }

            }

        }
    }
}


using System;

class Solution
{
    static void Main(string[] args)
    {
        int t = int.Parse(Console.ReadLine());
        int[] n = new int[t];
        int[][] a = new int[t][];
        for (int i = 0; i < t; i++)
        {
            n[i] = int.Parse(Console.ReadLine());
            a[i] = Array.ConvertAll(Console.ReadLine().Split(' '), x=>int.Parse(x));
        }
        for (int i = 0; i < t; i++)
        {
            var arr = a[i];
            if (arr.Length == 1)
            {
                Console.WriteLine("YES");
                continue;
            }
            Array.Sort(arr);
            Array.Reverse(arr);
            for (int j = 1; j < arr.Length;j++)
            {
                if (Math.Abs(arr[0] - arr[j]) <= 1)
                {
                    if (j == arr.Length - 1) Console.WriteLine("YES");
                    continue;
                }
                else
                {
                    Console.WriteLine("NO");
                    break;
                }
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class _1A
    {
        public static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int[] res = new int[N];
            for (int i = 0; i < N; i++)
            {
                int a = int.Parse(Console.ReadLine());
                int p = a;
                int max = 0;
                int[] numbers = new int[a];
                string[] s = Console.ReadLine().Split();
                for (int j = 0; j < a; j++)
                {
                    int cnt = 0;
                    for (int g = 0; g < j; g++)
                    {
                        if (numbers[g] == int.Parse(s[j]))
                            cnt++;
                    }
                    if (cnt == 0)
                    {
                        numbers[j] = int.Parse(s[j]);
                        if (numbers[j] > max)
                            max = numbers[j];
                    }
                    else
                        p--;
                }
                if ((p != max) && (p != 1))
                    res[i] = 0;
                else
                    res[i] = 1;
            }
            for(int i = 0; i < N; i++)
            {
                if (res[i] == 0)
                    Console.WriteLine("NO");
                else
                    Console.WriteLine("YES");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class _1A
    {
        public static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int[] res = new int[N];
            for (int i = 0; i < N; i++)
            {
                int a = int.Parse(Console.ReadLine());
                int p = a;
                int max = 0;
                int min = 101;
                int[] numbers = new int[a];
                string[] s = Console.ReadLine().Split();
                for (int j = 0; j < a; j++)
                {
                    int cnt = 0;
                    for (int g = 0; g < j; g++)
                    {
                        if (numbers[g] == int.Parse(s[j]))
                            cnt++;
                    }
                    if (cnt == 0)
                    {
                        numbers[j] = int.Parse(s[j]);
                        if (numbers[j] > max)
                            max = numbers[j];
                        if (numbers[j] < min)
                            min = numbers[j];
                    }
                    else
                        p--;
                }
                if ((p != max - min + 1) && (p != 1))
                    res[i] = 0;
                else
                    res[i] = 1;
            }
            for(int i = 0; i < N; i++)
            {
                if (res[i] == 0)
                    Console.WriteLine("NO");
                else
                    Console.WriteLine("YES");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class _1A
    {
        public static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int[] res = new int[N];
            for (int i = 0; i < N; i++)
            {
                int a = int.Parse(Console.ReadLine());
                int p = a;
                int max = 0;
                int[] numbers = new int[a];
                string[] s = Console.ReadLine().Split();
                int cnt = 0;
                for (int j = 0; j < a; j++)
                {
                    for (int g = 0; g < j; g++)
                    {
                        if (numbers[g] == int.Parse(s[j]))
                            cnt++;
                    }
                    if (cnt == 0)
                    {
                        numbers[j] = int.Parse(s[j]);
                        if (numbers[j] > max)
                            max = numbers[j];
                    }
                    else
                        p--;
                }
                if ((p != max) && (p != 1))
                    res[i] = 0;
                else
                    res[i] = 1;
            }
            for(int i = 0; i < N; i++)
            {
                if (res[i] == 0)
                    Console.WriteLine("NO");
                else
                    Console.WriteLine("YES");
            }
        }
    }
}


using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            for (int i = 0; i < t; i++)
            {
                int n = int.Parse(Console.ReadLine());
                int[] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                Array.Sort(a);
                Console.WriteLine(Enumerable.Range(0, a.Length - 1).Count(x => a[x + 1] - a[x] > 1) == 0 ? "YES" : "NO");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;

namespace Coursera
{
    static class Program
    {
        public static void Main(string[] args)
        {
            var caseNum = int.Parse(Console.ReadLine());

            for (int currentCaseNum = 0; currentCaseNum < caseNum; currentCaseNum++)
            {
                var stringLength = int.Parse(Console.ReadLine());
                var inputString = Console.ReadLine().Split(' ');

                var inputList = new List<int>();
                for (int i = 0; i < stringLength; i++)
                {
                    inputList.Add(int.Parse(inputString[i]));
                }
                inputList.Sort();

                var yesBool = true;

                for (int i = 0; i < stringLength - 1; i++)
                {
                    if (Math.Abs(inputList[i] - inputList[i + 1]) > 1)
                    {
                        Console.WriteLine("No");

                        yesBool = false;
                        i = stringLength;
                    }
                }

                if (yesBool)
                {
                    Console.WriteLine("Yes");
                }
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;

namespace Coursera
{
    static class Program
    {
        public static void Main(string[] args)
        {
            var caseNum = int.Parse(Console.ReadLine());

            for (int currentCaseNum = 0; currentCaseNum < caseNum; currentCaseNum++)
            {
                var stringLength = int.Parse(Console.ReadLine());
                var inputString = Console.ReadLine().Split(' ');

                var removeNum = 0;

                for (int i = 0; i < stringLength; i++)
                {
                    if (inputString[i] == "-1")
                    {
                        continue;
                    }

                    for (int j = 0; j < stringLength; j++)
                    {
                        if (inputString[i] == "-1" || inputString[j] == "-1")
                        {
                            continue;
                        }

                        if (i == j)
                        {
                            continue;
                        }

                        if (Math.Abs(int.Parse(inputString[i]) - int.Parse(inputString[j])) <= 1)
                        {
                            if (int.Parse(inputString[i]) < int.Parse(inputString[j]))
                            {
                                inputString[i] = "-1";
                                removeNum++;
                            }
                            else
                            {
                                inputString[j] = "-1";
                                removeNum++;
                            }
                        }
                    }
                }

                if (removeNum == stringLength - 1)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
        }
    }
}


using System;
using System.Linq;

namespace Task_1399A
{

    class Program
    {
        static void Main(string[] args)
        {
            int tests = int.Parse(Console.ReadLine());
            while(tests-- > 0)
            {
                int n = int.Parse(Console.ReadLine()), i=0;
                int[] cont =Console.ReadLine().Split().Select(int.Parse).ToArray();
                Array.Sort(cont);
                for( ; i < n-1; i++)
                    if (cont[i + 1] - cont[i] > 1)
                        break;

                Console.WriteLine(i == n - 1 ? "YES" : "NO");

            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Class08051
    {
        static void Main(string[] args)
        {
            String num = Console.ReadLine();
            int repeat = Convert.ToInt32(num);
            for (int i = 0; i < repeat; i++)
            {
                long n = Convert.ToInt64(Console.ReadLine());
                string[] sNums = Console.ReadLine().Split(' ');
                List<int> lNums = new List<int>(Array.ConvertAll(sNums, int.Parse));
                lNums.Sort();
                long temp = lNums[0];
                bool flg = true;
                foreach(var ll in lNums)
                {
                    if(Math.Abs(temp - ll) > 1)
                    {
                        Console.WriteLine("No");
                        flg = false;
                        break;
                    }
                    temp = ll;
                }
                if (flg)
                {
                    Console.WriteLine("Yes");
                }
            }
            //Console.Read();
        }
            }
}


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Numerics;

namespace cf661
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
            solve_cf661A();
            Console.Out.Flush();
        }

        public static void solve_cf661B()
        {
        }

        public static void solve_cf661A()
        {
            int t = Convert.ToInt32(Console.ReadLine());
            while (t-- > 0)
            {
                int n = Convert.ToInt32(Console.ReadLine());
                int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                Array.Sort(a);
                bool ok = true;
                for (int i = 0; i < n - 1; i++)
                {
                    int diff = Math.Abs(a[i] - a[i + 1]);
                    if (diff > 1)
                    {
                        ok = false;
                        break;
                    }
                }
                Console.WriteLine(ok ? "YES" : "NO");
            }
            /*int[] test = new int[5] {3, 5, 6, 8, 10};
            int[] keys = new int[9] {2, 3, 4, 5, 6, 8, 9, 10, 11};

            for (int i = 0; i < keys.Length; i++)
            {
                Console.WriteLine(binSearchLeft(test, keys[i]));
            }*/
        }

        public static int binSearchLeft(int[] a, int x)
        {
            int l = -1;
            int r = a.Length;
            int idx = -1;
            while (r > l + 1)
            {
                int mid = (l + r) / 2;
                if (a[mid] >= x)
                {
                    r = mid;
                    idx = mid;
                }
                else
                {
                    l = mid;
                }
            }
            return idx;
        }
    }
}


using System;
using System.IO;
using CompLib.Util;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int t = sc.NextInt();
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false});
        for (int i = 0; i < t; i++)
        {
            Q(sc);
        }

        Console.Out.Flush();
    }

    void Q(Scanner sc)
    {
        int n = sc.NextInt();
        int[] a = sc.IntArray();

        Array.Sort(a);
        for (int i = 1; i < n; i++)
        {
            if (a[i] - a[i - 1] <= 1)
            {

            }
            else
            {
                Console.WriteLine("NO");
                return;
            }
        }

        Console.WriteLine("YES");
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp24
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = int.Parse(Console.ReadLine());
            while (t-- > 0)
            {
                var n = int.Parse(Console.ReadLine());
                var a = Console.ReadLine().Split(' ');

                var liste = new List<int>();
                foreach (var b in a)
                {
                    liste.Add(int.Parse(b));

                }

                var min = liste.Min();
                var max = liste.Max();
                var result = "YES";

                for (int i = min; i <= max; i++) {
                    if (!liste.Contains(i)) { result = "NO";
                        break;
                    }
                }

                Console.WriteLine(result);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForce
{
    internal class Program
    {
        private static void Main(string[] args)
        {

            int n = Convert.ToInt32(Console.ReadLine());
            string[] answer = new string[n];
            List<int> input;

            for (int i = 0; i < n; i++)
            {
                int length = Convert.ToInt32(Console.ReadLine());
                IEnumerable<int> numsList = Console.ReadLine().Split(' ').Select(int.Parse);

                input = new List<int>(numsList);
                input.Sort();

                if(input.Count == 1)
                {
                    answer[i] = "YES";
                    continue;
                }

                int k = 0;
                while(k < input.Count-1)
                {

                    if (Math.Abs(input[k] - input[k + 1]) <= 1)
                    {
                        if (input[k] > input[k + 1])
                            input.RemoveAt(k + 1);
                        else
                            input.RemoveAt(k);
                    }
                    else
                        k++;

                }

                if (input.Count == 1)
                {
                    answer[i] = "YES";
                }
                else
                    answer[i] = "NO";

            }

            for (int i = 0; i < answer.Length; i++)
            {
                Console.WriteLine(answer[i]);
            }

        }
    }

}


using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForce
{
    internal class Program
    {
        private static void Main(string[] args)
        {

            int n = Convert.ToInt32(Console.ReadLine());
            string[] answer = new string[n];
            List<int> input;

            for (int i = 0; i < n; i++)
            {
                int length = Convert.ToInt32(Console.ReadLine());
                IEnumerable<int> numsList = Console.ReadLine().Split(' ').Select(int.Parse);

                input = new List<int>(numsList);

                if(input.Count == 1)
                {
                    answer[i] = "YES";
                    continue;
                }
                int k = 0;
                while(k < input.Count-1)
                {
                    if (Math.Abs(input[k] - input[k + 1]) <= 1)
                    {
                        if (input[k] > input[k + 1])
                            input.RemoveAt(k + 1);
                        else
                            input.RemoveAt(k);
                    }
                    else
                        k++;

                }
                if (input.Count == 1)
                {
                    answer[i] = "YES";
                }
                else
                    answer[i] = "NO";

            }

            for (int i = 0; i < answer.Length; i++)
            {
                Console.WriteLine(answer[i]);
            }

        }
    }

}


using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForce
{
    internal class Program
    {
        private static void Main(string[] args)
        {

            int n = Convert.ToInt32(Console.ReadLine());
            string[] answer = new string[n];
            List<int> input;

            for (int i = 0; i < n; i++)
            {
                int length = Convert.ToInt32(Console.ReadLine());
                IEnumerable<int> numsList = Console.ReadLine().Split(' ').Select(int.Parse);

                input = new List<int>(numsList);

                if(input.Count == 1)
                {
                    answer[i] = "YES";
                    continue;
                }
                int k = 0;
                while(k < input.Count-1)
                {

                    if (Math.Abs(input[k] - input[k + 1]) > 1)
                    {
                        answer[i] = "NO";
                        break;
                    }
                    k++;

                }
                if(answer[i] != "NO")
                    answer[i] = "YES";

            }

            for (int i = 0; i < answer.Length; i++)
            {
                Console.WriteLine(answer[i]);
            }

        }
    }

}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

class Test
{

    public static void Main()
    {
        var t = int.Parse(Console.ReadLine());
        while (t > 0)
        {
            t--;
            var n = int.Parse(Console.ReadLine());
            var arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            Array.Sort(arr);
            bool check = false;
            for (int i = 1; i < arr.Length; i++)
            {
                if (Math.Abs(arr[i] - arr[i - 1]) > 1)
                {
                    Console.Write("NO");
                    check = true;
                    break;
                }
            }

            if (check == false)
                Console.Write("YES");
            Console.WriteLine();
        }

    }

}


using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;

namespace codeforces
{
    public class Program
    {
        private const int NMax = 50;

        private static int[] a = new int[NMax];

        private static void Main(string[] args)
        {
            int t = Convert.ToInt32(Console.ReadLine());
            for (; t > 0; --t)
            {
                int n = Convert.ToInt32(Console.ReadLine());
                var values = Console.ReadLine().Split(' ');
                for (int i = 0; i < n; ++i)
                {
                    a[i] = Convert.ToInt32(values[i]);
                }
                Array.Sort(a, 0, n);
                bool good = true;
                for (int i = 1; i < n && good; ++i)
                {
                    if (a[i] - a[i - 1] > 1)
                    {
                        good = false;
                    }
                }
                Console.WriteLine(good ? "YES" : "NO");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using static System.Array;
using static System.Console;
using static System.Math;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var t = input.ReadInt();
      for (int i = 0; i < t; i++)
      {
        var n = input.ReadInt();
        var a = input.ReadIntArray(n);
        Sort(a);
        var d = 0;
        for (int j = 0; j < n - 1; j++)
          d = Max(d, a[j + 1] - a[j]);
        WriteLine(d <= 1 ? "YES" : "NO");
      }
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private readonly TextReader reader;

    public string ReadToEnd() => reader.ReadToEnd();

    public int ReadInt()
    {
      var c = SkipWs();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = reader.Read();
        if (c == -1)
          throw new EndOfStreamException("Digit expected, but end of stream occurs");
      }

      if (!char.IsDigit((char)c))
        throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");

      checked
      {
        var result = (char)c - '0';
        c = reader.Read();
        while (c > 0 && !char.IsWhiteSpace((char)c))
        {
          if (!char.IsDigit((char)c))
            throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
          result = result * 10 + (char)c - '0';
          c = reader.Read();
        }

        if (isNegative)
          result = -result;
        return result;
      }
    }

    public string ReadLine() => reader.ReadLine();

    public long ReadLong() => long.Parse(ReadToken());

    public double ReadDouble() => double.Parse(ReadToken(), CultureInfo.InvariantCulture);

    public int[] ReadIntArray(int n)
    {
      var a = new int[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadInt();
      return a;
    }

    public (int, int) Read2Int() => (ReadInt(), ReadInt());

    public (int, int, int) Read3Int() => (ReadInt(), ReadInt(), ReadInt());

    public (int, int, int, int) Read4Int() => (ReadInt(), ReadInt(), ReadInt(), ReadInt());

    public (long, long) Read2Long() => (ReadLong(), ReadLong());

    public long[] ReadLongArray(int n)
    {
      var a = new long[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadLong();
      return a;
    }

    public double[] ReadDoubleArray(int n)
    {
      var a = new double[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadDouble();
      return a;
    }

    public string ReadToken()
    {
      var c = SkipWs();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = reader.Read();
      }

      return sb.ToString();
    }

    private int SkipWs()
    {
      var c = reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  internal class Program
  {
    public static void Main()
    {
      var solver = new ProblemSolver(In);
      solver.Solve();
    }
  }

  #endregion
}


using System;
using System.Linq;

namespace Contest_661_div3
{
    class Program
    {
        static void Main(string[] args)
        {
            int testIterator = int.Parse(Console.ReadLine());
            int[] answer = new int[testIterator];
            for (int i = 0; i < testIterator; i++)
            {
                int arrLen = int.Parse(Console.ReadLine());
                var taskParam = Console.ReadLine().Split(' ');
                int MaxElem = 0;
                int MinElem = 100;
                for (int j =0; j<arrLen; j++)
                {
                    int a = int.Parse(taskParam[j]);
                    MaxElem = a > MaxElem ? a: MaxElem;
                    MinElem = a < MinElem ? a : MinElem;
                }

                for (int j = MinElem; j <= MaxElem; j++)
                {
                    answer[i] = 0;
                    foreach (string task in taskParam)
                    {
                        if (int.Parse(task)==j)
                        {
                            answer[i] = 1;
                        }
                    }
                    j = answer[i] == 0 ? MaxElem + 1 : j;
                }
            }
            foreach (int ans in answer)
            {
                Console.WriteLine("{0}", ans == 1 ? "YES" : "NO");
            }
        }
    }
}


using System;

namespace Solution
{
    class Solution
    {
        static void Main(string[] args)
        {
            int cases = int.Parse(Console.ReadLine());
            while (cases-- > 0)
            {
                int n = int.Parse(Console.ReadLine());
                int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), (item) => Convert.ToInt32(item));
                Array.Sort(input);
                string answer = "YES";
                for(int i =0; i<input.Length -1; i++)
                {
                    if(input[i+1] - input[i] > 1 )
                    {
                        answer = "NO";
                        break;
                    }
                }

                Console.WriteLine(answer);

            }
        }
    }
}


using System;
using System.Runtime.InteropServices.ComTypes;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(System.Console.ReadLine());

            for (int ii = 0; ii < t; ii++) {
                int n = int.Parse(System.Console.ReadLine());
                int[] a = new int[100];
                string inp = System.Console.ReadLine();
                string[] inp_arr = inp.Split(' ');
                for (int i = 0; i < n; i++)
                {
                    a[i] = int.Parse(inp_arr[i]);
                }
                Array.Sort(a, 0, n);
                bool res = true;
                for (int i = 1; i < n; i++)
                {
                    if (a[i - 1] + 1 < a[i])
                    {
                        res = false;
                        System.Console.WriteLine("NO");
                    }
                }
                if (res)
                    System.Console.WriteLine("YES");
            }
        }
    }
}


using System;
using System.Runtime.InteropServices.ComTypes;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(System.Console.ReadLine());

            for (int ii = 0; ii < t; ii++) {
                int n = int.Parse(System.Console.ReadLine());
                int[] a = new int[100];
                string inp = System.Console.ReadLine();
                string[] inp_arr = inp.Split(' ');
                for (int i = 0; i < n; i++)
                {
                    a[i] = int.Parse(inp_arr[i]);
                }
                Array.Sort(a, 0, n);
                bool res = true;
                for (int i = 1; i < n && res; i++)
                {
                    if (a[i - 1] + 1 < a[i])
                    {
                        res = false;
                        System.Console.WriteLine("NO");
                    }
                }
                if (res)
                    System.Console.WriteLine("YES");
            }
        }
    }
}


using System;
using System.Linq;

public class Program
{
    private static void Main()
    {
        var answers = new string[int.Parse(Console.ReadLine())];
        for (var i = 0; i < answers.Length; i++)
        {
            Console.ReadLine();
            var arr = Console.ReadLine().Split().Select(int.Parse).OrderBy(x=>x).Distinct().ToList();
            if (arr.Count == 1)
            {
                answers[i] = "YES";
                continue;
            }

            for (var j = 0; j < arr.Count-1; j++)
            {
                if (Math.Abs(arr.ElementAt(j) - arr.ElementAt(j + 1)) <= 1)
                {
                    arr.RemoveAt(j);
                }
            }

            if (arr.Count > 1) answers[i] = "NO";
            else answers[i] = "YES";
        }

        foreach (var a in answers)
        {
            Console.WriteLine(a);
        }
    }
}


using System;
using System.Linq;

public class Program
{
    private static void Main()
    {
        var answers = new string[int.Parse(Console.ReadLine())];
        for (var i = 0; i < answers.Length; i++)
        {
            Console.ReadLine();
            var arr = Console.ReadLine().Split().Select(int.Parse).OrderBy(x=>x).Distinct().ToList();
            if (arr.Count == 1)
            {
                answers[i] = "YES";
            }

            for (var j = 0; j < arr.Count-1; j++)
            {
                if (Math.Abs(arr.ElementAt(j) - arr.ElementAt(j + 1)) <= 1)
                {
                    arr.RemoveAt(j);
                }
            }

            if (arr.Count > 1) answers[i] = "NO";
            else answers[i] = "YES";
        }

        foreach (var a in answers)
        {
            Console.WriteLine(a);
        }
    }
}


using System;
using System.Linq;

public class Program
{
    private static void Main()
    {
        var answers = new string[int.Parse(Console.ReadLine())];
        for (var i = 0; i < answers.Length; i++)
        {
            Console.ReadLine();
            var arr = Console.ReadLine().Split().Select(int.Parse).OrderBy(x=>x).Distinct().ToList();
            if (arr.Count == 1)
            {
                answers[i] = "YES";
                continue;
            }

            for (var j = 0; j < arr.Count-1; j++)
            {
                if (Math.Abs(arr.ElementAt(j) - arr.ElementAt(j + 1)) > 1) continue;
                arr.RemoveAt(j);
                j--;
            }

            if (arr.Count > 1) answers[i] = "NO";
            else answers[i] = "YES";
        }

        foreach (var a in answers)
        {
            Console.WriteLine(a);
        }
    }
}


using System;
using System.Linq;
using System.Runtime.InteropServices;

public class Program
{
    private static void Main()
    {
        var answers = new string[int.Parse(Console.ReadLine())];
        for (var i = 0; i < answers.Length; i++)
        {
            Console.ReadLine();
            var arr = Console.ReadLine().Split().Select(int.Parse).OrderBy(x=>x).ToHashSet().ToList();
            if (arr.Count == 1)
            {
                answers[i] = "YES";
            }

            for (var j = 0; j < arr.Count-1; j++)
            {
                if (Math.Abs(arr.ElementAt(j) - arr.ElementAt(j + 1)) <= 1)
                {
                    arr.RemoveAt(j);
                }
            }

            if (arr.Count > 1) answers[i] = "NO";
            else answers[i] = "YES";
        }

        foreach (var a in answers)
        {
            Console.WriteLine(a);
        }
    }
}


using static System.Console;
using static System.Int32;
using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = Parse(ReadLine()), n;
            int[] m; bool f = false;
            string[] ans = new string[t];
            for (int i = 0; i < t; i++)
            {
                n = Parse(ReadLine());
                m = Array.ConvertAll(ReadLine().Split(), Parse);
                if (m.Length == 1)
                {
                    ans[i] = "YES";
                    continue;
                }
                Array.Sort(m);
                for (int j = 0; j < m.Length-1; j++)
                {
                    f = false;
                    if (m[j + 1] - m[j] > 1) break;
                    else f = true;
                }
                ans[i] = f ? "YES" : "NO";
            }
            for (int i = 0; i < t; i++)
            {
                WriteLine(ans[i]);
            }
        }
    }
}


using System;
using System.Linq;

namespace HelloWorld
{
    class Program
    {

        static void Main(string[] args)
        {
            int test = int.Parse(Console.ReadLine());
            for(int t=0; t<test; t++)
            {
                int n = int.Parse(Console.ReadLine());
                int[] ara = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                Array.Sort(ara);

                bool flag = false;

                for(int i=0; i<n-1; i++)
                {
                    int dif = ara[i + 1] - ara[i];
                    if (dif > 1)
                    {
                        flag = true;
                        break;
                    }
                }

                Console.WriteLine(flag ? "NO" : "YES");
            }
        }
    }
}


using System;
using System.IO;
using System.Text;

namespace Remove_Smallest
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            for (int i = 0; i < t; i++)
            {
                writer.WriteLine(Solve() ? "YES" : "NO");
            }
            writer.Flush();
        }

        private static bool Solve()
        {
            int n = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }
            Array.Sort(nn);

            for (int i = 1; i < n; i++)
            {
                if (nn[i] > nn[i - 1] + 1)
                    return false;
            }

            return true;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RootNamespace>Remove_Smallest</RootNamespace>
  </PropertyGroup>

</Project>


using System;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < t; i++)
            {
                int n = Convert.ToInt32(Console.ReadLine());
                string[] line = Console.ReadLine().Split(' ');
                int[] a = new int[n];
                for (int j = 0; j < n; j++)
                {
                    a[j] = Convert.ToInt32(line[j]);
                }
                for (int j = 0; j < n; j++)
                {
                    for (int k = j + 1; k < n; k++)
                    {
                        if (a[k] < a[j])
                        {
                            int temp = a[j];
                            a[j] = a[k];
                            a[k] = temp;
                        }
                    }
                }
                bool isOk = true;
                for (int j = 0; j < n-1; j++)
                {
                    if (a[j]+1 != a[j + 1] && a[j] != a[j + 1])
                    {
                        isOk = false;
                        break;
                    }
                }
                if (isOk)
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
        }
    }
}


using System;

class Solution
{
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        int n;
        int[] arr;

        while (t > 0)
        {
            n = int.Parse(Console.ReadLine());
            arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            Array.Sort(arr);

            if (n == 1) { Console.WriteLine("YES"); }
            else
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    for (int j = i + 1; j < arr.Length; j++)
                    {
                        if (Math.Abs(arr[i] - arr[j]) <= 1) { n--; }
                        if (n < 1) { break; }
                    }
                }
                if (n < 1) { Console.WriteLine("YES"); }
                else { Console.WriteLine("NO"); }
            }

            t--;
        }
    }
}


using System;

class Solution
{
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        int n;
        int[] arr;

        while (t > 0)
        {
            n = int.Parse(Console.ReadLine());
            arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            if (n == 1) { Console.WriteLine("YES"); }
            else
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    for (int j = i + 1; j < arr.Length; j++)
                    {
                        if (Math.Abs(arr[i] - arr[j]) <= 1) { n--; }
                        if (n < 1) { break; }
                    }
                }
                if (n < 1) { Console.WriteLine("YES"); }
                else { Console.WriteLine("NO"); }
            }

            t--;
        }
    }
}


using System;

class Solution
{
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        int n;
        int[] arr;

        while (t > 0)
        {
            n = int.Parse(Console.ReadLine());
            arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            if (n == 1) { Console.WriteLine("YES"); }
            else
            {
                for (int i = 0; i < arr.Length - 1; i++)
                {
                    for (int j = i + 1; j < arr.Length; j++)
                    {
                        if (Math.Abs(arr[i] - arr[j]) <= 1) { n--; break; }

                    }
                    if (n < 1) { break; }
                }
                if (n == 1) { Console.WriteLine("YES"); }
                else { Console.WriteLine("NO"); }
            }

            t--;
        }
    }
}


using System;

class Solution
{
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        int n;
        int[] arr;

        while (t > 0)
        {
            n = int.Parse(Console.ReadLine());
            arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            Array.Sort(arr);
            if (n == 1) { Console.WriteLine("YES"); }
            else
            {
                for (int i = 0; i < arr.Length - 1; i++)
                {
                    for (int j = i + 1; j < arr.Length; j++)
                    {
                        if (Math.Abs(arr[i] - arr[j]) <= 1) { n--; break; }

                    }
                    if (n < 1) { break; }
                }
                //Console.WriteLine("n wynosi: " + n);
                if (n == 1) { Console.WriteLine("YES"); }
                else { Console.WriteLine("NO"); }
            }

            t--;
        }
    }
}


using System;

class Solution
{
    static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        int n;
        int[] arr;

        while (t > 0)
        {
            n = int.Parse(Console.ReadLine());
            arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            Array.Sort(arr);
            if (n == 1) { Console.WriteLine("YES"); }
            else
            {
                for (int i = 0; i < arr.Length - 1; i++)
                {
                    for (int j = i + 1; j < arr.Length; j++)
                    {
                        if (Math.Abs(arr[i] - arr[j]) <= 1) { n--; break; }

                    }
                    if (n < 1) { break; }
                }
                Console.WriteLine("n wynosi: " + n);
                if (n == 1) { Console.WriteLine("YES"); }
                else { Console.WriteLine("NO"); }
            }

            t--;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Security.Cryptography;
using static System.Math;

namespace CodeForces
{
    class Program
    {
        static int[] ParseIntArr() => Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        static string[] ParseStringArr() => Console.ReadLine().Split();
        static int ParseInt() => int.Parse(Console.ReadLine());
        static long ParseLong() => long.Parse(Console.ReadLine());

        public static bool Possible(List<int> nums)
        {
            for (int i = 1; i < nums.Count; i++)
            {
                if (nums[i] - nums[i - 1] > 1)
                    return false;
            }
            return true;
        }

        static void Main(string[] args)
        {
            int t = ParseInt();
            while(t-- != 0)
            {
                int n = ParseInt();
                List<int> nums = Console.ReadLine().Split().Select(s=> int.Parse(s)).ToList();
                nums.Sort();
                Console.WriteLine(Possible(nums) ? "YES" : "NO");

            }
        }
    }
}


using System;

namespace Problem_3
{
    class Program
    {
        static void Main(string[] args)
        {
            int T = int.Parse(Console.ReadLine());

            for (int index = 0; index < T; index++)
            {
                var line = Console.ReadLine();
                string[] lineSplit = line.Split(' ');

                int N = int.Parse(lineSplit[0]);

                line = Console.ReadLine();
                lineSplit = line.Split(' ');

                var numbers = new int[N];
                for (int i = 0; i < N; i++)
                {
                    numbers[i] = int.Parse(lineSplit[i]);
                }

                Array.Sort(numbers);

                var count = 0;
                for (int i = 0; i < N - 1; i++)
                {
                    if (numbers[i + 1] > numbers[i] + 1)
                    {
                        count++;
                        break;
                    }
                }

                Console.WriteLine(count >= 1 ? "NO" : "YES");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForcesProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            int T = int.Parse(Console.ReadLine());
            int n = 0;
            int[] arr;
            for(int i=0;i<T;++i)
            {
                n = int.Parse(Console.ReadLine());
                arr = Console.ReadLine().Split().Take(n).Select(int.Parse).ToArray();

                    Array.Sort(arr);
                   Console.WriteLine(Enumerable.Range(0, n-1).Count(x => arr[x + 1] - arr[x] > 1) == 0 ? "YES" : "NO");
            }
         }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Codeforces
{

    public class C
    {

        public static void Main(string[] args)
        {
          int T = int.Parse(Console.ReadLine());

          for(int t=0;t<T;t++){
            int n = int.Parse(Console.ReadLine());
            string[] token = Console.ReadLine().Split();
            int[] a = new int[n];
            for(int i=0;i<n;i++){
              a[i] = int.Parse(token[i]);
            }
            Array.Sort(a);
            string ans = "YES";
            for(int i=0;i<n-1;i++){
               if(a[i+1]-a[i]>1){
                 ans = "NO";
                 break;
               }
            }
            Console.WriteLine(ans);
          }
        }

    }

}


using System;
using System.Collections.Generic;

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = Int32.Parse(Console.ReadLine());
            for (int i = 0; i < t; ++i)
            {
                var n = Int32.Parse(Console.ReadLine());
                var input = Console.ReadLine().Split(' ');
                var list = new List<int>();
                foreach (var elem in input)
                {
                    list.Add(int.Parse(elem));
                }

                list.Sort();
                bool result = true;
                for (int j = 0; j < list.Count - 1; ++j)
                {
                    if (list[j + 1] - list[j] > 1)
                    {
                        result = false;
                        break;
                    }
                }

                Console.WriteLine(result ? "YES" : "NO");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            for(int i = 0; i < t; i++)
            {
                bool flag = true;
                int n = int.Parse(Console.ReadLine());
                string[] aLine = Console.ReadLine().Split(' ');
                List<int> a = new List<int>();
                for(int j = 0; j < n; j++)
                    a.Add(int.Parse(aLine[j]));
                a.Sort();
                if(a.Count > 1)
                    for(int j = 1; j < n; j++)
                    {
                        if(Math.Abs(a[j] - a[j - 1]) > 1)
                        {
                            flag = false;
                            break;
                        }
                    }
                if(flag)
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            }
        }
    }
}


/* Date: 05.08.2020 *  Time: 22:45 */
//
// CF 661 A
//
//

using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

class Example
{
# if ( ! ONLINE_JUDGE )
	public static StreamReader sr = new StreamReader ("C:\\TRR\\2020\\Task\\07 Codeforces\\049\\A.TXT");
	public static StreamWriter sw = new StreamWriter ("C:\\TRR\\2020\\Task\\07 Codeforces\\049\\OUTPUT.OUT");
# endif

	public static void Main (string[] args)
	{
		NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;

		int qq;

# if ( ONLINE_JUDGE )
		qq = int.Parse (Console.ReadLine ());
# else
		qq = int.Parse (sr.ReadLine ());
		sw.WriteLine ("*** TEST = " + qq);
# endif

		for ( int _q=0; _q < qq; _q++ )
		{
# if ( ! ONLINE_JUDGE )
			sw.WriteLine ("*** " + _q);
# endif

			string s;
			int n;

# if ( ONLINE_JUDGE )
			n = int.Parse (Console.ReadLine ());
			s = Console.ReadLine ();
# else
			n = int.Parse (sr.ReadLine ());
			s = sr.ReadLine ();
# endif

			int [] a = new int [n];
			{
				string [] ss = s.Split (' ');
				for ( int i=0; i < n; i++ )
					a [i] = int.Parse (ss [i]);
				Array.Sort (a);
			}

# if ( ! ONLINE_JUDGE )
			sw.WriteLine ("*** n = " + n);
			sw.Write ("***");
			for ( int i=0; i < n; i++ )
				sw.Write (" " + a [i]);
			sw.WriteLine ();
# endif

			bool ok = true;
			for ( int i=1; i < n; i++ )
				if ( a [i] - a [i-1] > 1 )
				{
					ok = false;
					break;
				}

# if ( ONLINE_JUDGE )
			if ( ok )
				Console.WriteLine ("YES");
			else
				Console.WriteLine ("NO");
# else
			if ( ok )
				sw.WriteLine ("YES");
			else
				sw.WriteLine ("NO");
# endif
		}

# if ( ! ONLINE_JUDGE )
		sw.Close ();
# endif
	}
}


using System;
using System.Collections.Generic;
using System.IO;

namespace prA
{
    class Program
    {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter(@"..\..\output");
        private static readonly StreamReader reader = new StreamReader(@"..\..\input");
#endif

        static void Main(string[] args) {
            int t = NextInt();
            for (int ti = 0; ti < t; ti++) {
                int n = NextInt();
                int[] a = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = NextInt();
                }
                Array.Sort(a);
                int[] dd = new int[100];
                for (int i = 0; i < n - 1; i++) {
                    dd[a[i + 1] - a[i]]++;
                }
                writer.WriteLine(n - dd[0] - dd[1] <= 1 ? "YES" : "NO");
            }

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int NextInt() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
        private static long NextLong() {
            int c;
            long res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.Security.Policy;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Factorial
{
    class Program
    {
        static void Main(string[] args)
        {
            int q = Convert.ToInt32(Console.ReadLine());
            for (int j = 0; j < q; j++){
                int n = Convert.ToInt32(Console.ReadLine()); bool t = false;
                string[] s = Console.ReadLine().Split();int[] a = new int[s.Length];
                for (int i = 0; i < s.Length; i++) a[i] = Convert.ToInt32(s[i]);
                Array.Sort(a);
                for (int i = 0; i < a.Length-1; i++) {
                    if(a[i+1] - a[i] > 1) {
                        Console.WriteLine("NO");
                        t = true;
                        break;
                    }
                }
                if (t == false) Console.WriteLine("YES");
            }

            Console.ReadLine();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        for (int tt = ReadInt(); tt > 0; tt--)
        {
            int n = ReadInt();
            var a = ReadIntArray();

            Array.Sort(a);
            bool f = false;
            for (int i = 1; i < n; i++)
                if (a[i] > a[i - 1] + 1)
                    f = true;
            Write(f ? "NO" : "YES");
        }
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i]; }
        return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array) writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Globalization;

namespace FertiLib.Contest.A
{
	static class Program
	{
		public static void Solve(Scanner cin)
		{
			int _t = cin.ReadInt();
			for (int _i = 0; _i < _t; _i++)
			{
				int n = cin.ReadInt();
				var a = cin.ReadIntArray(n);
				Array.Sort(a);
				bool ok = true;
				for (int i = 1; i < n; i++)
				{
					if (a[i] - a[i - 1] > 1) ok = false;
				}
				YESNO(ok);
			}
		}

		public static void Main(string[] args)
		{
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
			Console.SetOut(sw);
			var cin = new Scanner();
			Solve(cin);
			Console.Out.Flush();
		}

		public static void YESNO(bool condition) => Console.WriteLine(condition ? "YES" : "NO");
		public static void YesNo(bool condition) => Console.WriteLine(condition ? "Yes" : "No");
		public static void yesno(bool condition) => Console.WriteLine(condition ? "yes" : "no");
	}

	static class Util
	{
		public static string Join<T>(this IEnumerable<T> x, string separator = "") => string.Join(separator, x);
	}

	class Printer : StreamWriter
	{
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
		public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { }
	}

	class Scanner
	{
		string[] s;
		int i;

		char[] separator = new char[] { ' ' };

		public Scanner()
		{
			s = new string[0];
			i = 0;
		}

		public string Read() => ReadString();

		public string ReadString()
		{
			if (i < s.Length) return s[i++];
			string st = Console.ReadLine();
			while (st == "") st = Console.ReadLine();
			s = st.Split(separator, StringSplitOptions.RemoveEmptyEntries);
			if (s.Length == 0) return ReadString();
			i = 0;
			return s[i++];
		}

		public string[] ReadStringArray(int N)
		{
			string[] Array = new string[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = ReadString();
			}
			return Array;
		}

		public int ReadInt()
		{
			return int.Parse(ReadString());
		}

		public int[] ReadIntArray(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = ReadInt() + add;
			}
			return Array;
		}

		public long ReadLong()
		{
			return long.Parse(ReadString());
		}

		public long[] ReadLongArray(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = ReadLong() + add;
			}
			return Array;
		}

		public double ReadDouble()
		{
			return double.Parse(ReadString());
		}

		public double[] ReadDoubleArray(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = ReadDouble() + add;
			}
			return Array;
		}

		public T1 ReadValue<T1>() => (T1)Convert.ChangeType(ReadString(), typeof(T1));

		public (T1, T2) ReadValue<T1, T2>()
		{
			var inputs = ReadStringArray(2);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			return (v1, v2);
		}

		public (T1, T2, T3) ReadValue<T1, T2, T3>()
		{
			var inputs = ReadStringArray(3);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
			return (v1, v2, v3);
		}

		public (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>()
		{
			var inputs = ReadStringArray(4);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
			var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
			return (v1, v2, v3, v4);
		}

		public (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>()
		{
			var inputs = ReadStringArray(5);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
			var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
			var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
			return (v1, v2, v3, v4, v5);
		}

		public (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>()
		{
			var inputs = ReadStringArray(6);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
			var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
			var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
			var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
			return (v1, v2, v3, v4, v5, v6);
		}

		public (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>()
		{
			var inputs = ReadStringArray(7);
			var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
			var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
			var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
			var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
			var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
			var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
			var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
			return (v1, v2, v3, v4, v5, v6, v7);
		}

		public T1[] ReadValueArray<T1>(int N)
		{
			var v1 = new T1[N];
			for (int i = 0; i < N; i++)
			{
				v1[i] = ReadValue<T1>();
			}
			return v1;
		}

		public (T1[], T2[]) ReadValueArray<T1, T2>(int N)
		{
			var (v1, v2) = (new T1[N], new T2[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2) = ReadValue<T1, T2>();
				v1[i] = t1;
				v2[i] = t2;
			}
			return (v1, v2);
		}

		public (T1[], T2[], T3[]) ReadValueArray<T1, T2, T3>(int N)
		{
			var (v1, v2, v3) = (new T1[N], new T2[N], new T3[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2, t3) = ReadValue<T1, T2, T3>();
				v1[i] = t1;
				v2[i] = t2;
				v3[i] = t3;
			}
			return (v1, v2, v3);
		}

		public (T1[], T2[], T3[], T4[]) ReadValueArray<T1, T2, T3, T4>(int N)
		{
			var (v1, v2, v3, v4) = (new T1[N], new T2[N], new T3[N], new T4[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2, t3, t4) = ReadValue<T1, T2, T3, T4>();
				v1[i] = t1;
				v2[i] = t2;
				v3[i] = t3;
				v4[i] = t4;
			}
			return (v1, v2, v3, v4);
		}

		public (T1[], T2[], T3[], T4[], T5[]) ReadValueArray<T1, T2, T3, T4, T5>(int N)
		{
			var (v1, v2, v3, v4, v5) = (new T1[N], new T2[N], new T3[N], new T4[N], new T5[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2, t3, t4, t5) = ReadValue<T1, T2, T3, T4, T5>();
				v1[i] = t1;
				v2[i] = t2;
				v3[i] = t3;
				v4[i] = t4;
				v5[i] = t5;
			}
			return (v1, v2, v3, v4, v5);
		}

		public (T1[], T2[], T3[], T4[], T5[], T6[]) ReadValueArray<T1, T2, T3, T4, T5, T6>(int N)
		{
			var (v1, v2, v3, v4, v5, v6) = (new T1[N], new T2[N], new T3[N], new T4[N], new T5[N], new T6[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2, t3, t4, t5, t6) = ReadValue<T1, T2, T3, T4, T5, T6>();
				v1[i] = t1;
				v2[i] = t2;
				v3[i] = t3;
				v4[i] = t4;
				v5[i] = t5;
				v6[i] = t6;
			}
			return (v1, v2, v3, v4, v5, v6);
		}

		public (T1[], T2[], T3[], T4[], T5[], T6[], T7[]) ReadValueArray<T1, T2, T3, T4, T5, T6, T7>(int N)
		{
			var (v1, v2, v3, v4, v5, v6, v7) = (new T1[N], new T2[N], new T3[N], new T4[N], new T5[N], new T6[N], new T7[N]);
			for (int i = 0; i < N; i++)
			{
				var (t1, t2, t3, t4, t5, t6, t7) = ReadValue<T1, T2, T3, T4, T5, T6, T7>();
				v1[i] = t1;
				v2[i] = t2;
				v3[i] = t3;
				v4[i] = t4;
				v5[i] = t5;
				v6[i] = t6;
				v7[i] = t7;
			}
			return (v1, v2, v3, v4, v5, v6, v7);
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                var integers = new List<int>();
                foreach (var elment in Elments)
                {
                    integers.Add(int.Parse(elment));
                }
                foreach (var Value in integers.OrderByDescending(x =>x))
                {

                    if (!inputs.Contains(Value) &&   !integers.Contains(Value - 1))
                    {
                        inputs.Add(Value);
                    }

                }

                if (inputs.Count > 1) if (integers.Contains(inputs[0] - 1) && integers.Count(x=> x == inputs[0]) <= 1 ) inputs.RemoveAt(0);

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                var integers = new List<int>();
                foreach (var elment in Elments)
                {
                    integers.Add(int.Parse(elment));
                }
                foreach (var Value in integers.OrderByDescending(x =>x))
                {

                    if (!inputs.Contains(Value) && !inputs.Contains(Value + 1) && !inputs.Contains(Value - 1))
                    {
                        inputs.Add(Value);
                    }
                    if (inputs.Count > 1) inputs.RemoveAt(0);
                }

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                var integers = new List<int>();
                foreach (var elment in Elments)
                {
                    integers.Add(int.Parse(elment));
                }
                foreach (var Value in integers.OrderByDescending(x =>x))
                {

                    if (!inputs.Contains(Value) && !inputs.Contains(Value + 1) && !inputs.Contains(Value - 1))
                    {
                        inputs.Add(Value);
                    }

                }

                if (inputs.Count > 1) if (integers.Contains(inputs[0] - 1) && integers.Count(x=> x == inputs[0]) <= 1 ) inputs.RemoveAt(0);

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                var integers = new List<int>();
                foreach (var elment in Elments)
                {
                    integers.Add(int.Parse(elment));
                }
                foreach (var Value in integers.OrderByDescending(x =>x))
                {

                    if (!inputs.Contains(Value) && !inputs.Contains(Value + 1) && !inputs.Contains(Value - 1))
                    {
                        inputs.Add(Value);
                    }

                }

                if (integers.Contains(inputs[0] - 1) && integers.Count(x=> x == inputs[0]) <= 1 ) inputs.RemoveAt(0);

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                var Elments = Console.ReadLine().Split(" ");
                foreach (var Value in Elments)
                {
                    var Elment = int.Parse(Value);
                    if (!inputs.Contains(Elment) && !inputs.Contains(Elment + 1) && !inputs.Contains(Elment - 1))
                    {
                        inputs.Add(Elment);
                    }

                }

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(" ");
                foreach (var Value in Elments)
                {
                    var Elment = int.Parse(Value);
                    if (!inputs.Contains(Elment) && !inputs.Contains(Elment + 1) && !inputs.Contains(Elment - 1))
                    {
                        inputs.Add(Elment);
                    }

                }

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


  class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                var Elments = Console.ReadLine().Split(" ");
                foreach (var Value in Elments)
                {
                    var Elment = int.Parse(Value);
                    if (!inputs.Contains(Elment) && !inputs.Contains(Elment + 1) && !inputs.Contains(Elment - 1))
                    {
                        inputs.Add(Elment);
                    }

                }

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                var integers = new List<int>();
                foreach (var elment in Elments)
                {
                    integers.Add(int.Parse(elment));
                }
                foreach (var Value in integers.OrderByDescending(x =>x))
                {

                    if (!inputs.Contains(Value) && !integers.Contains(Value + 1) && !integers.Contains(Value - 1))
                    {
                        inputs.Add(Value);
                    }

                }

                if (inputs.Count > 1) if (integers.Contains(inputs[0] - 1) && integers.Count(x=> x == inputs[0]) <= 1 ) inputs.RemoveAt(0);

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections.Generic;

namespace Remove_Smallest
{
    class Program
    {
        static void Main(string[] args)
        {
            var answers = new List<string>();
            var NumberOfTries = int.Parse(Console.ReadLine());
            for (int i = 0; i < NumberOfTries; i++)
            {
                var InputAmount = int.Parse(Console.ReadLine());
                var inputs = new List<int>();
                string[] Elments = Console.ReadLine().ToString().Split(' ');
                foreach (var Value in Elments)
                {
                    var Elment = int.Parse(Value);
                    if (!inputs.Contains(Elment) && !inputs.Contains(Elment + 1) && !inputs.Contains(Elment - 1))
                    {
                        inputs.Add(Elment);
                    }

                }

                if (inputs.Count > 1)
                {
                    answers.Add("NO");
                }
                else
                {
                    answers.Add("YES");
                }
            }

            foreach (var item in answers)
            {
                Console.WriteLine(item);
            }
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
//using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using static Math2;
using static Output;
using static Utils;

public class CP
{
    Input sc;
    public void Solve()
    {
        sc = new Input();
        bool multicases = true;
        var t = multicases ? sc.Int : 1;
        // var sw = new Stopwatch();
        // sw.Start();
        while (t-- > 0)
        {
            c1();
        }
        // sw.Stop();
        //Put(sw.ElapsedMilliseconds + "ms");
    }
    public void c1()
    {
        int n = sc.Int;
        var a = sc.Intarr.sort();
        for (int i = 0; i < n - 1; ++i)
        {
            if (a[i + 1] - a[i] > 1)
            {
                Put("NO");
                return;

            }
        }
        Put("YES");
    }
}

public class PriorityQueue<T>
{
    List<T> _item;
    public int Count { get { return _item.Count; } }
    bool _isascend { get; set; }
    public T Peek { get { return _item[0]; } }
    Comparison<T> Comp;
    public PriorityQueue(bool IsAscend = true, IEnumerable<T> list = null) : this(Comparer<T>.Default.Compare, IsAscend, list) { }
    public PriorityQueue(Comparison<T> cmp, bool IsAscend = true, IEnumerable<T> list = null)
    {
        _item = new List<T>();
        _isascend = IsAscend;
        this.Comp = cmp;
        if (list != null)
        {
            _item.AddRange(list);
            Build();
        }
    }

    private int Compare(int i, int j) => (_isascend ? -1 : 1) * Comp(_item[i], _item[j]);
    private void Swap(int i, int j) { var t = _item[i]; _item[i] = _item[j]; _item[j] = t; }
    private int Parent(int i) => (i - 1) >> 1;
    private int Left(int i) => (i << 1) + 1;
    public T Enqueue(T val)
    {
        int i = _item.Count;
        _item.Add(val);
        while (i > 0)
        {
            int p = Parent(i);
            if (Compare(i, p) > 0)
                Swap(i, p);
            i = p;
        }
        return val;
    }
    private void Heapify(int index)
    {
        for (int i = index, j;
            (j = Left(i)) < _item.Count; i = j)
        {
            if (j != _item.Count - 1 && Compare(j, j + 1) < 0) j++;
            if (Compare(i, j) < 0)
                Swap(i, j);
        }
    }
    public T Dequeue()
    {
        T val = _item[0];
        _item[0] = _item[_item.Count - 1];
        _item.RemoveAt(_item.Count - 1);
        Heapify(0);
        return val;
    }
    private void Build()
    {
        for (var i = (_item.Count >> 1) - 1; i >= 0; i--)
            Heapify(i);
    }
    public bool Any() => Count > 0;
}
public class BinarySearch
{
    public static int Lower_Bound<T>(IList<T> Array, T Target)
    {
        return Lower_Bound<T>(Array, Target, Comparer<T>.Default.Compare);
    }
    public static int Lower_Bound<T>(IList<T> Array, T Target, Comparison<T> Comp)
    {
        var cmp = Comparer<T>.Create(Comp);
        var l = -1; //always ng
        var r = Array.Count(); //always ok
        while (r - l > 1)
        {
            var mid = l + (r - l) / 2;
            var res = cmp.Compare(Array[mid], Target);
            if (res >= 0) r = mid;
            else l = mid;
        }
        return r;
    }
    public static int Upper_Bound<T>(IList<T> Array, T Target)
    {
        return Upper_Bound<T>(Array, Target, Comparer<T>.Default.Compare);
    }
    public static int Upper_Bound<T>(IList<T> Array, T Target, Comparison<T> Comp)
    {
        var cmp = Comparer<T>.Create(Comp);
        var l = -1;
        var r = Array.Count;
        while (r - l > 1)
        {
            var mid = l + (r - l) / 2;
            var res = cmp.Compare(Array[mid], Target);
            if (res > 0) r = mid;
            else l = mid;
        }
        return r;
    }
    public static bool Contains<T>(IList<T> Arr, T Target)
    {
        return Contains<T>(Arr, Target, Comparer<T>.Default.Compare);
    }
    public static bool Contains<T>(IList<T> Arr, T Target, Comparison<T> Comp)
    {
        return (Upper_Bound(Arr, Target, Comp) - Lower_Bound(Arr, Target, Comp) > 0);
    }
}
public static class Math2
{
    public const int INF = 1 << 29;
    public const long INFL = 1L << 62;
    public const long MOD = 1000000007;
    public const long MOD2 = 998244353;

    public static long Power(long a, long b, long MOD = 1000000007) //i^N
    {
        long res = 1;
        while (b > 0)
        {
            if ((b & 1) != 0) res = res * a % MOD;
            a = a * a % MOD;
            b >>= 1;
        }
        return (res + 2 * MOD) % MOD;
    }
    public static long Power2(long a, long b) //i^N
    {
        long res = 1;
        while (b > 0)
        {
            if ((b & 1) != 0) res = res * a;
            a = a * a;
            b >>= 1;
        }
        return res;
    }
    public static BigInteger Power2BI(BigInteger a, BigInteger b) //i^N
    {
        BigInteger res = 1;
        while (b > 0)
        {
            if ((b & 1) != 0) res = res * a;
            a = a * a;
            b >>= 1;
        }
        return res;
    }
    public static long GCD(long a, long b)
    {
        if (a == 0) return b;
        while (b > 0)
        {
            var r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static long LCM(long a, long b) => (b / GCD(a, b)) * a;
    public static long Comb(long n, long r, int MOD = 1000000007)
    {
        if (r > n - r) r = n - r;
        long Nume = 1;
        long Deno = 1;

        if (r > n - r) r = n - r;
        for (long i = 1; i <= r; ++i)
        {
            Deno = (Deno * i) % MOD;
            Nume = Nume * (n - i + 1) % MOD;
        }
        return (Nume * inv(Deno)) % MOD;
    }
    public static long Comb2(long n, long r)
    {
        long Nume = 1;
        long Deno = 1;

        if (r > n - r) r = n - r;
        for (long i = 1; i <= r; ++i)
        {
            Deno *= i;
            Nume *= n - i + 1;
        }
        return Nume / Deno;
    }
    public static long inv(long x, int MOD = 1000000007)
    {
        return Power(x, MOD - 2, MOD);
    }
}
public static class Utils
{
    public static T[] sort<T>(this T[] a)
    {
        Array.Sort(a);
        return a;
    }
    public static long popcnt(long n)
    {
        n = (n & 0x55555555) + (n >> 1 & 0x55555555);
        n = (n & 0x33333333) + (n >> 2 & 0x33333333);
        n = (n & 0x0f0f0f0f) + (n >> 4 & 0x0f0f0f0f);
        n = (n & 0x00ff00ff) + (n >> 8 & 0x00ff00ff);
        n = (n & 0x0000ffff) + (n >> 16 & 0x0000ffff);
        return n;
    }
    public static int popcnt(BigInteger a)
    {
        int cnt = 0;
        while (a > 0)
        {
            if ((a & 1) == 1) ++cnt;
            a >>= 1;
        }
        return cnt;
    }
    public static void Swap<T>(ref T A, ref T B)
    {
        T x = A;
        A = B;
        B = x;
    }
    public static int DigitSum(string N)
    {

        int ret = 0;
        for (int i = 0; i < N.Length; ++i) ret += N[i] - '0';
        return ret;
    }
    public static string ConvertBase(char[] Num, int from, int to)
    {
        if (new string(Num) == "0") return "0";
        char[] sample = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
        BigInteger ten = 0;
        int power = 0;
        for (int i = Num.Length - 1; i >= 0; --i)
        {
            ten += (BigInteger)(Array.IndexOf(sample, Num[i])) * Power2BI(from, power);
            ++power;
        }
        if (to == 10)
        {
            return ten.ToString();
        }
        var ret = new List<char>();
        while (ten > 0)
        {
            ret.Add(sample[(int)ten % to]);
            ten /= to;
        }
        ret.Reverse();
        return new string(ret.ToArray());
    }
    public static bool NextPermutation<T>(IList<T> lis, Comparison<T> cmp)
    {
        int n = lis.Count;
        int i = n - 1;
        while (i - 1 >= 0)
        {
            if (cmp(lis[i - 1], lis[i]) < 0) break;
            --i;
        }
        if (i == 0) return false;
        int j = i;
        while (j + 1 < n)
        {
            if (cmp(lis[i - 1], lis[j + 1]) > 0) break;
            ++j;
        }
        var _q = lis[j];
        lis[j] = lis[i - 1];
        lis[i - 1] = _q;
        int k = i;
        int l = n - 1;
        while (k < l)
        {
            var _p = lis[k];
            lis[k] = lis[l];
            lis[l] = _p;

            ++k;
            --l;
        }
        return true;
    }
    public static bool NextPermutation<T>(IList<T> lis) => NextPermutation(lis, Comparer<T>.Default.Compare);
}
class Program
{
    static void Main(string[] args)
    {
        var CP = new CP();
        CP.Solve();
    }
}
public static class Output
{

    public static void Put(string a) => Console.WriteLine(a);
    public static void Put(params object[] i) => Put(string.Join(" ", i));
    public static void Put<T>(IEnumerable<T> a) => Put(string.Join(" ", a));
    public static void PutV<T>(IEnumerable<T> a) { foreach (var z in a) Put(z); }
    public static void YN(bool i)
    {
        if (i) Put("Yes");
        else Put("No");
    }
}
public class Input
{
    public static string Str => Console.ReadLine();
    public static bool IsTypeEqual<T, U>() => typeof(T).Equals(typeof(U));
    public static T ConvertType<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
    public static T Cast<T>(string s)
    {
        if (IsTypeEqual<T, int>()) return ConvertType<T, int>(int.Parse(s));
        else if (IsTypeEqual<T, long>()) return ConvertType<T, long>(long.Parse(s));
        else if (IsTypeEqual<T, double>()) return ConvertType<T, double>(double.Parse(s));
        else if (IsTypeEqual<T, char>()) return ConvertType<T, char>(char.Parse(s));
        else if (IsTypeEqual<T, BigInteger>()) return ConvertType<T, BigInteger>(BigInteger.Parse(s));
        else if (IsTypeEqual<T, decimal>()) return ConvertType<T, decimal>(decimal.Parse(s));
        else return ConvertType<T, string>(s);
    }
    public static T[] Castarr<T>(string[] s)
    {

        var ret = new T[s.Length];
        int i = 0;
        if (IsTypeEqual<T, char>())
        {
            var list = new List<T>();
            foreach (var t in s)
            {
                foreach (var u in t)
                {
                    list.Add(ConvertType<T, char>(char.Parse(u.ToString())));
                }
            }
            return list.ToArray();
        }
        foreach (var t in s)
        {
            if (IsTypeEqual<T, int>()) ret[i++] = ConvertType<T, int>(int.Parse(t));
            else if (IsTypeEqual<T, long>()) ret[i++] = ConvertType<T, long>(long.Parse(t));
            else if (IsTypeEqual<T, double>()) ret[i++] = ConvertType<T, double>(double.Parse(t));
            else if (IsTypeEqual<T, BigInteger>()) ret[i++] = ConvertType<T, BigInteger>(BigInteger.Parse(t));
            else ret[i++] = ConvertType<T, string>(t);
        }
        return ret;
    }
    Queue<string> q = new Queue<string>();
    void next() { var ss = Str.Split(' '); foreach (var item in ss) q.Enqueue(item); }
    public T cin<T>() { if (!q.Any()) next(); return Cast<T>(q.Dequeue()); }
    public T[] cinarr<T>() { return Castarr<T>(Str.Split(' ')); }
    public T[] cinarr<T>(int n) { var ret = new T[n]; for (int i = 0; i < n; ++i) ret[i] = cin<T>(); return ret; }
    public int Int => cin<int>();
    public long Long => cin<long>();
    public double Double => cin<double>();
    public char Char => cin<char>();
    public string String => cin<string>();
    public BigInteger BI => cin<BigInteger>();
    public int[] Intarr => cinarr<int>();
    public long[] Longarr => cinarr<long>();
    public double[] Doublearr => cinarr<double>();
    public char[] Chararr => cinarr<char>();
    public string[] Stringarr => cinarr<string>();
    public BigInteger[] BIarr => cinarr<BigInteger>();
    public void cin<T>(out T t) { t = cin<T>(); }
    public void mul<T, U>(out T t, out U u) { t = cin<T>(); u = cin<U>(); }
    public void mul<T, U, V>(out T t, out U u, out V v) { t = cin<T>(); u = cin<U>(); v = cin<V>(); }
    public void mul<T, U, V, W>(out T t, out U u, out V v, out W w) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); }
    public void mul<T, U, V, W, X>(out T t, out U u, out V v, out W w, out X x) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); }
    public void mul<T, U, V, W, X, Y>(out T t, out U u, out V v, out W w, out X x, out Y y) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); y = cin<Y>(); }
    public void mul<T, U, V, W, X, Y, Z>(out T t, out U u, out V v, out W w, out X x, out Y y, out Z z) { t = cin<T>(); u = cin<U>(); v = cin<V>(); w = cin<W>(); x = cin<X>(); y = cin<Y>(); z = cin<Z>(); }
}