// Why am I so dumb? :c
// chrono::system_clock::now().time_since_epoch().count()

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << '\n';

#define fi first
#define se second

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int MAXN = (int)1e3 + 5;

vector<vector<int> > V[10];

pll me[10], you[MAXN];

int col[10][MAXN];

int pos[10][MAXN];

bool used[MAXN];

int pw[10];

int k, n;

void pre() {
    pw[0] = 1;

    for (int i = 1; i < 10; ++i) {
        pw[i] = (pw[i - 1] << 1);
    }
}

pll operator +(pll a, pll b) {
    return mp(a.fi + b.fi, a.se + b.se);
}

pll operator -(pll a, pll b) {
    return mp(a.fi - b.fi, a.se - b.se);
}

ll cross(pll a, pll b) {
    return a.fi * b.se - a.se * b.fi;
}

ll area(pll a, pll b, pll c) {
    return cross(b - a, c - a);
}

bool cmp(int a, int b) {
    return you[a] < you[b];
}

bool bit(int x, int p) {
    return x & pw[p];
}

int calc(int m, vector<int> P) {
    if (P.empty()) {
        return 1;
    }

    if (P.size() > __builtin_popcount(m)) {
        return 0;
    }

    for (int i = 1; i <= k; ++i) {
        if (bit(m, i - 1)) {
            int c = col[i][P[0]];
            int p = pos[i][P[0]];

            vector<int> NP;

            for (int j = 1; j < P.size(); ++j) {
                NP.pb(P[j]);
            }

            for (int j = 0; j < p; ++j) {
                NP.pb(V[i][c][j]);
            }

            sort(all(NP));
            NP.resize(unique(all(NP)) - NP.begin());

            if (calc(m - pw[i - 1], NP)) {
                return 1;
            }
        }
    }

    return 0;
}

void solve() {
    scanf("%d %d", &k, &n);

    for (int i = 1; i <= k; ++i) {
        scanf("%lld %lld", &me[i].fi, &me[i].se);
    }

    for (int i = 1; i <= n; ++i) {
        scanf("%lld %lld", &you[i].fi, &you[i].se);
    }

    for (int i = 1; i <= k; ++i) {
        for (int j = 1; j <= n; ++j) {
            used[j] = 0;
        }

        while (1) {
            int p = 1;

            while (p <= n && used[p]) {
                ++p;
            }

            if (p > n) {
                break;
            }

            vector<int> tmp;

            for (int j = 1; j <= n; ++j) {
                if (!used[j]) {
                    if (area(me[i], you[p], you[j]) == 0) {
                        tmp.pb(j);
                        used[j] = 1;
                    }
                }
            }

            V[i].pb(tmp);
        }
    }

    for (int i = 1; i <= k; ++i) {
        vector<vector<int> > repl;
        vector<int> A, B;

        for (vector<int> &tmp : V[i]) {
            for (int p : tmp) {
                if (you[p] <= me[i]) {
                    A.pb(p);
                }
                else {
                    B.pb(p);
                }
            }

            sort(all(A), cmp);
            reverse(all(A));
            sort(all(B), cmp);

            if (!A.empty()) {
                for (int j = 0; j < A.size(); ++j) {
                    col[i][A[j]] = repl.size();
                    pos[i][A[j]] = j;
                }

                repl.pb(A);
                A.clear();
            }

            if (!B.empty()) {
                for (int j = 0; j < B.size(); ++j) {
                    col[i][B[j]] = repl.size();
                    pos[i][B[j]] = j;
                }

                repl.pb(B);
                B.clear();
            }
        }

        V[i] = repl;
    }

    //for (int i = 1; i <= k; ++i) {
        //printf("PRINTING %d:\n", i);
        //printf("%d GROUPS\n", V[i].size());

        //for (int j = 0; j < V[i].size(); ++j) {
            //printf("GROUP %d:", j + 1);

            //for (int x : V[i][j]) {
                //printf(" %d", x);
            //}

            //printf("\n");
        //}

        //printf("---\n");
    //}

    int ans = 0;

    for (int i = 1; i <= n; ++i) {
        if (calc(pw[k] - 1, vector<int>(1, i)) == 1) {
            //printf("! %d\n", i);
            ++ans;
        }
    }

    printf("%d\n", ans);
}

int main() {
    int tt = 1;

    pre();

    while (tt--) {
        solve();
    }

    return 0;
}


// Why am I so dumb? :c
// chrono::system_clock::now().time_since_epoch().count()

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << '\n';

#define fi first
#define se second

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int MAXN = (int)1e3 + 5;

vector<vector<int> > V[MAXN];

pll me[10], you[MAXN];

int dp[205][MAXN];

int col[10][MAXN];

int pos[10][MAXN];

bool used[MAXN];

int pw[10];

int k, n;

void pre() {
    pw[0] = 1;

    for (int i = 1; i < 10; ++i) {
        pw[i] = (pw[i - 1] << 1);
    }
}

pll operator +(pll a, pll b) {
    return mp(a.fi + b.fi, a.se + b.se);
}

pll operator -(pll a, pll b) {
    return mp(a.fi - b.fi, a.se - b.se);
}

ll cross(pll a, pll b) {
    return a.fi * b.se - a.se * b.fi;
}

ll area(pll a, pll b, pll c) {
    return cross(b - a, c - a);
}

bool cmp(int a, int b) {
    return you[a] < you[b];
}

bool bit(int x, int p) {
    return x & pw[p];
}

int calc(int m, vector<int> P) {
    if (P.empty()) {
        return 1;
    }

    if (m == 0 || P.size() > __builtin_popcount(m)) {
        return 0;
    }

    for (int i = 1; i <= k; ++i) {
        if (bit(m, i - 1)) {
            int c = col[i][P[0]];
            int p = pos[i][P[0]];

            if (p > k) {
                continue;
            }

            vector<int> NP;

            for (int j = 1; j < P.size(); ++j) {
                NP.pb(P[j]);
            }

            for (int j = 0; j < p; ++j) {
                NP.pb(V[i][c][j]);
            }

            sort(all(NP));
            NP.resize(unique(all(NP)) - NP.begin());

            if (calc(m - pw[i - 1], NP)) {
                return 1;
            }
        }
    }

    return 0;
}

void solve() {
    scanf("%d %d", &k, &n);

    for (int i = 1; i <= k; ++i) {
        scanf("%lld %lld", &me[i].fi, &me[i].se);
    }

    for (int i = 1; i <= n; ++i) {
        scanf("%lld %lld", &you[i].fi, &you[i].se);
    }

    for (int i = 1; i <= k; ++i) {
        for (int j = 1; j <= n; ++j) {
            used[j] = 0;
        }

        while (1) {
            int p = 1;

            while (p <= n && used[p]) {
                ++p;
            }

            if (p > n) {
                break;
            }

            vector<int> tmp;

            for (int j = 1; j <= n; ++j) {
                if (!used[j]) {
                    if (area(me[i], you[p], you[j]) == 0) {
                        tmp.pb(j);
                        used[j] = 1;
                    }
                }
            }

            V[i].pb(tmp);
        }
    }

    for (int i = 1; i <= k; ++i) {
        vector<vector<int> > repl;
        vector<int> A, B;

        for (vector<int> &tmp : V[i]) {
            for (int p : tmp) {
                if (you[p] <= me[i]) {
                    A.pb(p);
                }
                else {
                    B.pb(p);
                }
            }

            sort(all(A), cmp);
            reverse(all(A));
            sort(all(B), cmp);

            if (!A.empty()) {
                for (int j = 0; j < A.size(); ++j) {
                    col[i][A[j]] = repl.size();
                    pos[i][A[j]] = j;
                }

                repl.pb(A);
                A.clear();
            }

            if (!B.empty()) {
                for (int j = 0; j < B.size(); ++j) {
                    col[i][B[j]] = repl.size();
                    pos[i][B[j]] = j;
                }

                repl.pb(B);
                B.clear();
            }
        }

        V[i] = repl;
    }

    //for (int i = 1; i <= k; ++i) {
        //printf("PRINTING %d:\n", i);
        //printf("%d GROUPS\n", V[i].size());

        //for (int j = 0; j < V[i].size(); ++j) {
            //printf("GROUP %d:", j + 1);

            //for (int x : V[i][j]) {
                //printf(" %d", x);
            //}

            //printf("\n");
        //}

        //printf("---\n");
    //}

    for (int m = 0; m < pw[k]; ++m) {
        for (int i = 1; i <= n; ++i) {
            dp[m][i] = -1;
        }
    }

    int ans = 0;

    for (int i = 1; i <= n; ++i) {
        if (calc(pw[k] - 1, vector<int>(1, i)) == 1) {
            //printf("! %d\n", i);
            ++ans;
        }
    }

    printf("%d\n", ans);
}

int main() {
    int tt = 1;

    pre();

    while (tt--) {
        solve();
    }

    return 0;
}


// Why am I so dumb? :c
// chrono::system_clock::now().time_since_epoch().count()

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << '\n';

#define fi first
#define se second

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int MAXN = (int)1e3 + 5;

vector<vector<int> > V[10];

pll me[10], you[MAXN];

int col[10][MAXN];

int pos[10][MAXN];

bool used[MAXN];

int pw[10];

int k, n;

void pre() {
    pw[0] = 1;

    for (int i = 1; i < 10; ++i) {
        pw[i] = (pw[i - 1] << 1);
    }
}

pll operator +(pll a, pll b) {
    return mp(a.fi + b.fi, a.se + b.se);
}

pll operator -(pll a, pll b) {
    return mp(a.fi - b.fi, a.se - b.se);
}

ll cross(pll a, pll b) {
    return a.fi * b.se - a.se * b.fi;
}

ll area(pll a, pll b, pll c) {
    return cross(b - a, c - a);
}

bool cmp(int a, int b) {
    return you[a] < you[b];
}

bool bit(int x, int p) {
    return x & pw[p];
}

int calc(int m, vector<int> P) {
    if (P.empty()) {
        return 1;
    }

    if (P.size() > __builtin_popcount(m)) {
        return 0;
    }

    for (int i = 1; i <= k; ++i) {
        if (bit(m, i - 1)) {
            for (int idx = 0; idx < P.size(); ++idx) {
                int c = col[i][P[idx]];
                int p = pos[i][P[idx]];

                if (p > k) {
                    continue;
                }

                vector<int> NP;

                for (int j = 0; j < P.size(); ++j) {
                    if (j != idx) {
                        NP.pb(P[j]);
                    }
                }

                for (int j = 0; j < p; ++j) {
                    NP.pb(V[i][c][j]);
                }

                sort(all(NP));
                NP.resize(unique(all(NP)) - NP.begin());

                if (calc(m - pw[i - 1], NP)) {
                    return 1;
                }
            }
        }
    }

    return 0;
}

void solve() {
    scanf("%d %d", &k, &n);

    for (int i = 1; i <= k; ++i) {
        scanf("%lld %lld", &me[i].fi, &me[i].se);
    }

    for (int i = 1; i <= n; ++i) {
        scanf("%lld %lld", &you[i].fi, &you[i].se);
    }

    for (int i = 1; i <= k; ++i) {
        for (int j = 1; j <= n; ++j) {
            used[j] = 0;
        }

        while (1) {
            int p = 1;

            while (p <= n && used[p]) {
                ++p;
            }

            if (p > n) {
                break;
            }

            vector<int> tmp;

            for (int j = 1; j <= n; ++j) {
                if (!used[j]) {
                    if (area(me[i], you[p], you[j]) == 0) {
                        tmp.pb(j);
                        used[j] = 1;
                    }
                }
            }

            V[i].pb(tmp);
        }
    }

    for (int i = 1; i <= k; ++i) {
        vector<vector<int> > repl;
        vector<int> A, B;

        for (vector<int> &tmp : V[i]) {
            for (int p : tmp) {
                if (you[p] <= me[i]) {
                    A.pb(p);
                }
                else {
                    B.pb(p);
                }
            }

            sort(all(A), cmp);
            reverse(all(A));
            sort(all(B), cmp);

            if (!A.empty()) {
                for (int j = 0; j < A.size(); ++j) {
                    col[i][A[j]] = repl.size();
                    pos[i][A[j]] = j;
                }

                repl.pb(A);
                A.clear();
            }

            if (!B.empty()) {
                for (int j = 0; j < B.size(); ++j) {
                    col[i][B[j]] = repl.size();
                    pos[i][B[j]] = j;
                }

                repl.pb(B);
                B.clear();
            }
        }

        V[i] = repl;
    }

    // for (int i = 1; i <= k; ++i) {
    //     printf("PRINTING %d:\n", i);
    //     printf("%d GROUPS\n", V[i].size());

    //     for (int j = 0; j < V[i].size(); ++j) {
    //         printf("GROUP %d:", j + 1);

    //         for (int x : V[i][j]) {
    //             printf(" %d", x);
    //         }

    //         printf("\n");
    //     }

    //     printf("---\n");
    // }

    int ans = 0;

    for (int i = 1; i <= n; ++i) {
        if (calc(pw[k] - 1, vector<int>(1, i)) == 1) {
            //printf("! %d\n", i);
            ++ans;
        }
    }

    printf("%d\n", ans);
}

int main() {
    int tt = 1;

    pre();

    while (tt--) {
        solve();
    }

    return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

const int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace input {
    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}

using namespace input;

namespace output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T> void prContain(const T& x) {
        pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; // const needed for vector<bool>
        pr("}");
    }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps(); // no space at end of line
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...); // print w/ spaces
    }
}

using namespace output;

namespace io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0); // fast I/O
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
    }
}

using namespace io;

template<class T> T invGeneral(T a, T b) {
    a %= b; if (a == 0) return b == 1 ? 0 : -1;
    T x = invGeneral(b,a);
    return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
}

template<class T> struct modular {
    T val;
    explicit operator T() const { return val; }
    modular() { val = 0; }
    modular(const ll& v) {
        val = (-MOD <= v && v <= MOD) ? v : v % MOD;
        if (val < 0) val += MOD;
    }

    friend ostream& operator<<(ostream& os, const modular& a) { return os << a.val; }
    friend bool operator==(const modular& a, const modular& b) { return a.val == b.val; }
    friend bool operator!=(const modular& a, const modular& b) { return !(a == b); }
    friend bool operator<(const modular& a, const modular& b) { return a.val < b.val; }

    modular operator-() const { return modular(-val); }
    modular& operator+=(const modular& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
    modular& operator-=(const modular& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
    modular& operator*=(const modular& m) { val = (ll)val*m.val%MOD; return *this; }
    friend modular pow(modular a, ll p) {
        modular ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend modular inv(const modular& a) {
        auto i = invGeneral(a.val,MOD); assert(i != -1);
        return i;
    } // equivalent to return exp(b,MOD-2) if MOD is prime
    modular& operator/=(const modular& m) { return (*this) *= inv(m); }

    friend modular operator+(modular a, const modular& b) { return a += b; }
    friend modular operator-(modular a, const modular& b) { return a -= b; }
    friend modular operator*(modular a, const modular& b) { return a *= b; }

    friend modular operator/(modular a, const modular& b) { return a /= b; }
};

typedef modular<int> mi;
typedef pair<mi,mi> pmi;
typedef vector<mi> vmi;
typedef vector<pmi> vpmi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int k,n;
vpi a, m;
vi bad[7][1000];

bool cross(pi a, pi b, pi c) {
	return (ll)(b.f-a.f)*(c.s-a.s) == (ll)(b.s-a.s)*(c.f-a.f);
}

bool col(pi x, pi y, pi z) {
	return cross(x,y,z) && min(x,z) < y && y < max(x,z);
}

bool dfs(vi lst, vi fst, int x) {
	if (!sz(fst)) return 1;
	// ps("ZZ",lst,fst,x);
	int mx = __builtin_popcount(x)-1;
	F0R(i,k) if (x&(1<<i)) trav(j,fst) {
		bool ok = 1; auto LST = lst, FST = fst;
		LST.pb(j); FST.erase(find(all(FST),j));
		trav(t,bad[i][j]) {
			if (find(all(lst),t) != lst.end()) { ok = 0; break; }
			if (find(all(FST),t) == FST.end()) {
				FST.pb(t);
				if (sz(FST) > mx) { ok = 0; break; }
			}
		}
		if (ok && dfs(LST,FST,x^(1<<i))) return 1;
	}
	return 0;
}

int main() {
    setIO(); re(k,n);
    a.rsz(k); re(a); m.rsz(n); re(m);
    F0R(i,k) F0R(x,n) F0R(y,n) if (x != y && col(a[i],m[x],m[y])) {
    	bad[i][y].pb(x);
    	// ps(i,x,y,a[i],m[x],m[y]);
    }
    int ans = 0;
    F0R(i,n) {
    	ans += dfs({},{i},(1<<k)-1);
    	// ps("HUH",i,m[i],ans);
    }
    ps(ans);
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.IOException;
public class removeSmallest {
	static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	static String solve(int n, int[] a) {
		Arrays.sort(a);
		boolean ok = true;
		for(int i = 1 ; i <  n ; i++) {
			if((a[i] - a[i-1]) > 1) {
				ok = false;

			}
		}
		//System.out.println(ok);
		return (ok)? "YES":"NO";
	}

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		int t = Integer.parseInt(br.readLine());
		while(t-- > 0) {
			int n = Integer.parseInt(br.readLine());
			int[] a = new int[n];
			String line = br.readLine();
			String[] strs = line.trim().split("\\s+");
			for(int i = 0 ; i < n ; i ++) {
				a[i] = Integer.parseInt(strs[i]);
			}
			String res = solve(n,a);
		    System.out.println(res);
		}

	}

}


import java.util.*;
public class HelloWorld{
    static Scanner sc = new Scanner(System.in);

    public static boolean solve(){
        int min = 0, index = 0;
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0  ; i < n ; i++){
            a[i] = sc.nextInt();
        }
        for(int i = 0 ; i < n-1 ; i++){
            for(int j = i+1 ; j < n ; j++){
            if(Math.abs(a[i] - a[j]) > 1){
                continue;
                //return false;
            }
            else{
                if(a[i] > a[j]){
                    min = a[j];
                    index = j;
                }
                else{
                    min = a[i];
                    index = i;
                }
                a[index] = 0;
            }
          }
        }
        int count = 0;
        for(int i = 0 ; i < n ; i++){
            if(a[i] > 0){
                count++;
            }
        }
        return (count==1)? true:false;
        //return false;
    }

     public static void main(String []args){
        //Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-- > 0){
            boolean res = solve();
            if(res == true)
                System.out.println("YES");
            else
                System.out.println("NO");

        }
     }
}


import java.util.*;
public class HelloWorld{
    static Scanner sc = new Scanner(System.in);

    public static boolean solve(){
        int min = 0, index = 0;
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0  ; i < n ; i++){
            a[i] = sc.nextInt();
        }
        for(int i = 0 ; i < n-1 ; i++){
            if(Math.abs(a[i] - a[i+1]) > 1){
                //continue;
                return false;
            }
            else{
                if(a[i] > a[i+1]){
                    min = a[i+1];
                    index = i+1;
                }
                else{
                    min = a[i];
                    index = i;
                }
                a[index] = 0;
            }
        }
        int count = 0;
        for(int i = 0 ; i < n ; i++){
            if(a[i] > 0){
                count++;
            }
        }
        return (count==1)? true:false;
        //return false;
    }

     public static void main(String []args){
        //Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-- > 0){
            boolean res = solve();
            if(res == true)
                System.out.println("YES");
            else
                System.out.println("NO");

        }
     }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.IOException;
public class removeSmallest {
	static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	static String solve(int n, int[] a) {
		Arrays.sort(a);
		boolean ok = true;
		for(int i = 1 ; i <  n ; i++) {
			if((a[i] - a[i-1]) > 1) {
				ok = false;
				break;
			}
		}
		//System.out.println(ok);
		return (ok)? "YES":"NO";
	}

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		int t = Integer.parseInt(br.readLine());
		while(t-- > 0) {
			int n = Integer.parseInt(br.readLine());
			int[] a = new int[n];
			String line = br.readLine();
			String[] strs = line.trim().split("\\s+");
			for(int i = 0 ; i < n ; i ++) {
				a[i] = Integer.parseInt(strs[i]);
			}
			String res = solve(n,a);
		    System.out.println(res);
		}

	}

}


import java.util.Arrays;
import java.util.Scanner;
public class div659a {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt(), n= 0;
		while(t!=0) {
			n = sc.nextInt();
			if(n > 1) {
				int[] arr = new int[n];
				for(int i = 0;i<n;i++)
					arr[i] = sc.nextInt();
				Arrays.parallelSort(arr);
				boolean check = false;
				for(int i = 1;i<arr.length;i++) {
					if(arr[i] - arr[i-1] >= 2)
					{
						System.out.println("NO");
						check = true;
						break;
					}
				}
				if(!check) {
					System.out.println("YES");
				}
			}else {
				n = sc.nextInt();
				System.out.println("YES");
			}

			t--;
		}
		sc.close();
	}

}


import java.util.Scanner;
public class div659a {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt(), n= 0;
		while(t!=0) {
			n = sc.nextInt();
			if(n > 1) {
				int[] arr = new int[n];
				for(int i = 0;i<n;i++)
					arr[i] = sc.nextInt();
				boolean check = false;
				boolean check2 = false;
				for(int i = 0;i<arr.length;i++) {
					check = false;
					for(int j = 0;j<arr.length;j++) {
						if(i != j)
						{
							if(!(Math.abs(arr[i] - arr[j]) >= 2)) {
								check = true;
							}
						}
					}
					if(!check) {
						System.out.println("NO");
						check2 = true;
						break;
					}
				}
				if(!check2) {
					System.out.println("YES");
				}
			}else {
				n = sc.nextInt();
				System.out.println("YES");
			}

			t--;
		}
		sc.close();
	}

}


import java.util.Scanner;
public class div659a {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt(), n= 0;
		while(t!=0) {
			n = sc.nextInt();
			if(n > 1) {
				int[] arr = new int[n];
				for(int i = 0;i<n;i++)
					arr[i] = sc.nextInt();
				boolean check = false;
				boolean check2 = false;
				int counter = 0;
				for(int i = 0;i<arr.length;i++) {
					check = false;
					for(int j = 0;j<arr.length;j++) {
						if(i != j)
						{
							if((Math.abs(arr[i] - arr[j]) == 1)||(Math.abs(arr[i] - arr[j]) == 0)) {
								check = true;
							}
						}
					}

					if(!check) {
						System.out.println("NO");
						check2 = true;
						break;
					}
				}
				if(!check2) {
					System.out.println("YES");
				}
			}else {
				n = sc.nextInt();
				System.out.println("YES");
			}

			t--;
		}
		sc.close();
	}

}


import java.util.Arrays;
import java.util.Scanner;
public class div659a {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt(), n= 0;
		while(t!=0) {
			n = sc.nextInt();
			if(n > 1) {
				int[] arr = new int[n];
				for(int i = 0;i<n;i++)
					arr[i] = sc.nextInt();
				Arrays.parallelSort(arr);
				boolean check = false;
				boolean check2 = false;
				for(int i = 0;i<arr.length;i++) {
					check = false;
					for(int j = 0;j<arr.length;j++) {
						if(i != j)
						{
							if(!(Math.abs(arr[i] - arr[j]) >= 2)) {
								check = true;
							}
						}
					}
					if(!check) {
						System.out.println("NO");
						check2 = true;
						break;
					}
				}
				if(!check2) {
					System.out.println("YES");
				}
			}else {
				n = sc.nextInt();
				System.out.println("YES");
			}

			t--;
		}
		sc.close();
	}

}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = iCopy + 1; j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == iCopy) {
								++iCopy;
							}
							a[index] = -1;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = iCopy + 1; j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == j) {
								int temp = a[iCopy];
								a[iCopy] = a[j];
								a[j] = temp;
								index = iCopy;
							}
							a[index] = -1;
							++iCopy;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				if (a[i] != -1) {
					for (int j = i + 1; j < N; ++j) {
						if (Math.abs(a[i] - a[j]) <= 1) {
							int index = a[i] > a[j] ? j : i;
							a[index] = -1;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = iCopy + 1; j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == iCopy) {
								++iCopy;
							}
							a[index] = -1;
						}
					}
				}
			}
			for (int i = 0; i < N; ++i) {
				if (a[i] == -1) {
					++deleted;
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			Arrays.sort(a);
			boolean flag = false;
			for (int i = 0; i < N- 1 && !flag; ++i) {
				if (a[i + 1] - a[i] > 1) {
					flag = true;
				}
			}
			if (flag) {
				System.out.println("NO");
			} else {
				System.out.println("YES");
			}
			/*for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = iCopy + 1; j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == j) {
								int temp = a[iCopy];
								a[iCopy] = a[j];
								a[j] = temp;
								index = iCopy;
							}
							a[index] = -1;
							++iCopy;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}*/
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = 0; j!=iCopy && j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == j) {
								int temp = a[iCopy];
								a[iCopy] = a[j];
								a[j] = temp;
								index = iCopy;
							}
							a[index] = -1;
							++iCopy;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				if (a[i] != -1) {
					for (int j = i + 1; j < N; ++j) {
						if (Math.abs(a[i] - a[j]) <= 1) {
							int index = a[i] > a[j] ? j : i;
							if (index == i) {
								++i;
							}
							a[index] = -1;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = 0; j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == iCopy) {
								++iCopy;
							}
							a[index] = -1;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				if (a[i] != -1) {
					for (int j = i + 1; j < N; ++j) {
						if (Math.abs(a[i] - a[j]) <= 1) {
							int index = a[i] > a[j] ? j : i;
							a[index] = -1;
							++deleted;
							break;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;
public class RemoveSmallest {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		while (T-- > 0) {
			int N = in.nextInt();
			int[] a = new int[N];
			int deleted = 0;
			for (int i = 0; i < N; ++i) {
				a[i] = in.nextInt();
			}
			for (int i = 0; i < N; ++i) {
				int iCopy = i;
				if (a[iCopy] != -1) {
					for (int j = 0; j!=iCopy && j < N; ++j) {
						if (Math.abs(a[iCopy] - a[j]) <= 1) {
							int index = a[iCopy] < a[j] ? iCopy : j;
							if (index == iCopy) {
								++iCopy;
							} else {
								int temp = a[iCopy];
								a[iCopy] = a[j];
								a[j] = temp;
								index = iCopy;
							}
							a[index] = -1;
							++deleted;
						}
					}
				}
			}
			if (deleted == N - 1) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}


//package programs;
import java.util.*;
import java.lang.*;
import java.io.*;

public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();

		outer: while(t-- > 0)
		{
			int n = sc.nextInt();
			int[] a = new int[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = sc.nextInt();
			}
			Arrays.sort(a);

			 for(int i = 1;i<n;i++)
			{
				if(a[i] - a[i-1] > 1)
				{
					System.out.println("NO");
					continue outer;
				}
			}
			System.out.println("YES");
		}
}
}


//package programs;
import java.util.*;
import java.lang.*;
import java.io.*;

public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();

		while(t-- > 0)
		{
			int n = sc.nextInt();
			int[] a = new int[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = sc.nextInt();
			}
			ArrayList<Integer> arr = new ArrayList<>();

			int i = 0;
			int j = n-1;
			while(i<=j)
			{
				if(a[i] == a[j])
				{
					j--;
				}
				else if(Math.abs(a[i] - a[j])<=1)
				{
					if(a[i] < a[j])
					{
						i++;
					}
					else if(a[j] < a[i])
					{
						j--;
					}
				}
				arr.add(a[i]);

				i++;
				j--;
			}
			if(areSame(a))
			{
				System.out.println("YES");
			}
			else if(arr.size() == 1)
			{
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
		}
	}
	public static boolean areSame(int ck[])
    {
		int first = ck[0];
       for (int i=1; i<ck.length; i++)
           if (ck[i] != first)
                return false;
       return true;
    }
}


//package programs;
import java.util.*;
import java.lang.*;
import java.io.*;

public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();

		while(t-- > 0)
		{
			int n = sc.nextInt();
			int[] a = new int[n];
			for(int i = 0;i<n;i++)
			{
				a[i] = sc.nextInt();
			}
			Arrays.sort(a);

			for(int i = 1;i<n;i++)
			{
				if(a[i] - a[i-1] > 1)
				{
					System.out.println("NO");
				}
			}
			System.out.println("YES");
		}
}
}


import java.util.Arrays;
import java.util.Scanner;

public class RemoveSmallest {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        int t = s.nextInt();

        while (t-- > 0) {

            int n = s.nextInt();
            int a[]=new int[n];

            boolean found=false;

            for(int i=0;i<n;i++)
                a[i]=s.nextInt();

            Arrays.sort(a);

            for(int i=0;i<n-1;i++){
                if(found==false && a[i+1]-a[i]>1){
                    found=true;
                }
            }
            if(found==false)
                System.out.println("YES");
            else
                System.out.println("NO");

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class RemoveSmallest {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        int t = s.nextInt();

        while (t-- > 0) {

            int n = s.nextInt();
            int a[]=new int[n];

            Arrays.sort(a);
            boolean found=false;

            for(int i=0;i<n;i++)
                a[i]=s.nextInt();

            for(int i=0;i<n-1;i++){
                if(found==false && Math.abs(a[i+1]-a[i])>1){
                    found=true;
                    break;
                }
            }
            if(found==false)
            System.out.println("YES");
            else
            System.out.println("NO");

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class RemoveSmallest {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        int t = s.nextInt();

        while (t-- > 0) {

            int n = s.nextInt();
            int a[]=new int[n];

            Arrays.sort(a);
            boolean found=false;

            for(int i=0;i<n;i++)
                a[i]=s.nextInt();

            for(int i=0;i<n-1;i++){
                if(found==false && a[i+1]-a[i]>1){
                    found=true;
                }
            }
            if(found==false)
                System.out.println("YES");
            else
                System.out.println("NO");

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class RemoveSmallest {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        int t = s.nextInt();

        while (t-- > 0) {

            int n = s.nextInt();
            int a[]=new int[n];

            Arrays.sort(a);
            boolean found=false;

            for(int i=0;i<n;i++)
                a[i]=s.nextInt();

            for(int i=0;i<n-1;i++){
                if(found==false && a[i+1]-a[i]>1){
                    found=true;
                    break;
                }
            }
            if(found==false)
            System.out.println("YES");
            else
            System.out.println("NO");

        }

    }
}


import java.io.*;
public class Indices {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int i, j, t, n, c, r, l, m, x;
        int[] a;
        String sa, na;
        char ch;
        boolean check;
        t = Integer.parseInt(br.readLine());
        for (int in = 1; in <= t; in++) {
            check = false;
            l = 1;
            n = Integer.parseInt(br.readLine());
            a = new int[n];
            sa = br.readLine();
            sa = sa + " ";
            na = "";
            m = sa.length();
            x = 0;
            for (int f = 0; f < m; f++) {
                ch = sa.charAt(f);
                if (ch != ' ') na = na + ch;
                else {
                    a[x] = Integer.parseInt(na);
                    x++;
                    na = "";
                }
            }
            if (n == 1) check = true;
            else {
                i = smallest(a, n - l);
                for (j = 0; j <= n - l; j++) {
                    if (j != i) {
                        c = Math.abs(a[i] - a[j]);
                        if (c == 1 || c == 0) {
                            if (a[i] < a[j]) r = i;
                            else r = j;
                            for (int del = r + 1; del <= n - l; del++) a[del - 1] = a[del];
                            a[n - l] = 0;
                            if (a[1] == 0) check = true;
                            l++;
                            i = smallest(a, n - l);
                            j = -1;
                        }
                    }
                }
            }
            if (check) System.out.println("YES");
            else System.out.println("NO");
        }
    }
    public static int smallest(int []arr, int l) {
        int s = 101,i,r = 0;
        for (i = 0; i <= l; i++) {
            if(arr[i] < s) {
                s = arr[i];
                r = i;
            }
        }
        return r;
    }
}


import java.io.*;
public class Indices {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int i, j, t, n, c, r, l, m, x;
        int[] a;
        String sa;
        boolean check;
        t = Integer.parseInt(br.readLine());
        for (int in = 1; in <= t; in++) {
            check = false;
            l = 1;
            n = Integer.parseInt(br.readLine());
            a = new int[n];
            sa = br.readLine();
            m = n + (n - 1);
            x = 0;
            for (int f = 0; f < m; f+=2) {
                a[x] = sa.charAt(f);
                x++;
            }
            if (n == 1) check = true;
            else {
                i = smallest(a, n - l);
                for (j = 0; j <= n - l; j++) {
                    if (j != i) {
                        c = Math.abs(a[i] - a[j]);
                        if (c == 1 || c == 0) {
                            if (a[i] < a[j]) r = i;
                            else r = j;
                            for (int del = r + 1; del <= n - l; del++) a[del - 1] = a[del];
                            a[n - l] = 0;
                            if (a[1] == 0) check = true;
                            l++;
                            i = smallest(a, n - l);
                            j = -1;
                        }
                    }
                }
            }
            if (check) System.out.println("YES");
            else System.out.println("NO");
        }
    }
    public static int smallest(int []arr, int l) {
        int s = 101,i,r = 0;
        for (i = 0; i <= l; i++) {
            if(arr[i] < s) {
                s = arr[i];
                r = i;
            }
        }
        return r;
    }
}


import java.io.*;
public class Indices {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int i, j, t, n, c, r, l;
        int[] a;
        boolean check;
        t = Integer.parseInt(br.readLine());
        for (int in = 1; in <= t; in++) {
            check = false;
            l = 1;
            n = Integer.parseInt(br.readLine());
            a = new int[n];
            for (int f = 0; f < n; f++) a[f] = Integer.parseInt(br.readLine());
            if (n == 1) check = true;
            else {
                i = smallest(a, n - l);
                for (j = 0; j <= n - l; j++) {
                    if (j != i) {
                        c = Math.abs(a[i] - a[j]);
                        if (c == 1 || c == 0) {
                            if (a[i] < a[j]) r = i;
                            else r = j;
                            for (int del = r + 1; del <= n - l; del++) a[del - 1] = a[del];
                            a[n - l] = 0;
                            if (a[1] == 0) check = true;
                            l++;
                            i = smallest(a, n - l);
                            j = -1;
                        }
                    }
                }
            }
            if (check) System.out.println("YES");
            else System.out.println("NO");
        }
    }
    public static int smallest(int []arr, int l) {
        int s = 101,i,r = 0;
        for (i = 0; i <= l; i++) {
            if(arr[i] < s) {
                s = arr[i];
                r = i;
            }
        }
        return r;
    }
}


import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int tc = scn.nextInt();

		while(tc-- > 0) {

			int n = scn.nextInt();

			int[] arr = new int[n];

			for(int i=0;i<n;i++) {
				arr[i] = scn.nextInt();
			}

			for(int i=0;i<n;i++) {
				for(int j=i+1;j<n;j++) {
					if(Math.abs(arr[i] - arr[j]) <= 1) {
						if(arr[i] <= arr[j]) {
							arr[i] = -1;
							i = i+1;
						}else {
							arr[j] = -1;
						}
					}
				}
			}

			int count = 0;

			for(int val : arr) {
				if(val >= 1) {
					count++;
				}

				if(count > 1) {
					System.out.println("NO");
					break;
				}
			}

			if(count == 1) {
				System.out.println("YES");
			}

		}

	}

}


import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int tc = scn.nextInt();

		while (tc-- > 0) {

			int n = scn.nextInt();

			int[] arr = new int[n];

			for (int i = 0; i < n; i++) {
				arr[i] = scn.nextInt();
			}

			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if ( j != i && Math.abs(arr[i] - arr[j]) <= 1) {
						if (arr[i] <= arr[j]) {
							arr[i] = -1;
							i = i + 1;
						} else {
							arr[j] = -1;
						}
					}
				}
			}

			int count = 0;

			for (int val : arr) {
				if (val >= 1) {
					count++;
				}

				if (count > 1) {
					System.out.println("NO");
					break;
				}
			}

			if (count == 1) {
				System.out.println("YES");
			}

		}

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int tc = scn.nextInt();

		while (tc-- > 0) {

			int n = scn.nextInt();

			int[] arr = new int[n];

			for (int i = 0; i < n; i++) {
				arr[i] = scn.nextInt();
			}

			Arrays.sort(arr);

			for (int i = 0; i < n; i++) {

				if(arr[i] == -1)
					continue;

				for (int j = 0; j < n; j++) {

					if(arr[j] == -1)
						continue;

					if ( j != i && Math.abs(arr[i] - arr[j]) <= 1) {
						if (arr[i] <= arr[j]) {
							arr[i] = -1;
						} else {
							arr[j] = -1;
						}
					}
				}
			}

			int count = 0;

			for (int val : arr) {
				if (val >= 1) {
					count++;
				}

				if (count > 1) {
					System.out.println("NO");
					break;
				}
			}

			if (count == 1) {
				System.out.println("YES");
			}

		}

	}

}


import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int tc = scn.nextInt();

		while (tc-- > 0) {

			int n = scn.nextInt();

			int[] arr = new int[n];

			for (int i = 0; i < n; i++) {
				arr[i] = scn.nextInt();
			}

			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if ( j != i && Math.abs(arr[i] - arr[j]) <= 1) {
						if (arr[i] <= arr[j]) {
							arr[i] = -1;
						} else {
							arr[j] = -1;
						}
					}
				}
			}

			int count = 0;

			for (int val : arr) {
				if (val >= 1) {
					count++;
				}

				if (count > 1) {
					System.out.println("NO");
					break;
				}
			}

			if (count == 1) {
				System.out.println("YES");
			}

		}

	}

}


import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int tc = scn.nextInt();

		while (tc-- > 0) {

			int n = scn.nextInt();

			int[] arr = new int[n];

			for (int i = 0; i < n; i++) {
				arr[i] = scn.nextInt();
			}

			for (int i = 0; i < n; i++) {

				if(arr[i] == -1)
					continue;

				for (int j = 0; j < n; j++) {

					if(arr[j] == -1)
						continue;

					if ( j != i && Math.abs(arr[i] - arr[j]) <= 1) {
						if (arr[i] <= arr[j]) {
							arr[i] = -1;
						} else {
							arr[j] = -1;
						}
					}
				}
			}

			int count = 0;

			for (int val : arr) {
				if (val >= 1) {
					count++;
				}

				if (count > 1) {
					System.out.println("NO");
					break;
				}
			}

			if (count == 1) {
				System.out.println("YES");
			}

		}

	}

}


import java.util.*;

public class Solution{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for(int i = 1; i <= t; i++){
            int n = sc.nextInt();
            int[] A = new int[n];
            for(int j = 0; j < n; j++)
                A[j] = sc.nextInt;
            int max = 0;
            for(int j = 0; j < n; j++){
                if(A[j] > max)
                    max = A[j];
            }
            int[] C = new int[max+1];
            for(int j = 0; j < n; j++)
                C[A[j]]++;
            int c = 0; boolean ch = true;
            for(int j = 1; j <= max; j++){
                if(C[j] != 0) c++;
                else if(C[j] == 0 && c != 0){
                    ch = false; break;
                }
            }
            if(ch){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}


import java.util.*;

public class Solution{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for(int i = 1; i <= t; i++){
            int n = sc.nextInt();
            int[] A = new int[n];
            for(int j = 0; j < n; j++{
                A[j] = sc.nextInt;
            }
            int max = 0;
            for(int j = 0; j < n; j++){
                if(A[j] > max)
                    max = A[j];
            }
            int[] C = new int[max+1];
            for(int j = 0; j < n; j++){
                C[A[j]]++;
            }
            int c = 0; boolean ch = true;
            for(int j = 1; j <= max; j++){
                if(C[j] != 0) c++;
                else if(C[j] == 0 && c != 0){
                    ch = false; break;
                }
            }
            if(ch){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}


import java.util.*;

public class Solution{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for(int i = 1; i <= t; i++){
            int n = sc.nextInt();
            int[] A = new int[n];
            for(int j = 0; j < n; j++)
                A[j] = sc.nextInt();
            int max = 0;
            for(int j = 0; j < n; j++){
                if(A[j] > max)
                    max = A[j];
            }
            int[] C = new int[max+1];
            for(int j = 0; j < n; j++)
                C[A[j]]++;
            int c = 0; boolean ch = true;
            for(int j = 1; j <= max; j++){
                if(C[j] != 0) c++;
                else if(C[j] == 0 && c != 0){
                    ch = false; break;
                }
            }
            if(ch){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}


import java.util.Scanner;

public class Ex52 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int t=s.nextInt();
        while (t>0) {
            int n = s.nextInt();
            int[] a = new int[n];
            int f = 0;
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
            }
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if (Math.abs(a[i] - a[j]) > 1) {
                        f = 1;
                        break;
                    }
                }
            }
            if (f == 1) {
                System.out.println("NO");
            } else {
                System.out.println("YES");
            }
            t -= 1;
        }
    }
}


import java.util.Scanner;

public class Ex52 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int t=s.nextInt();
        while (t>0) {
            int n = s.nextInt();
            int[] a = new int[n];
            int f = 0;
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
            }
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if (Math.abs(a[i] - a[j]) > 1) {
                        f = 1;
                        break;
                    }
                }
            }
            if (f == 1) {
                System.out.println("No");
            } else {
                System.out.println("Yes");
            }
            t -= 1;
        }
    }
    }


package com.Azar;
import java.util.Scanner;

public class Ex52 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int t=s.nextInt();
        while (t>0) {
            int n = s.nextInt();
            int[] a = new int[n];
            int f = 0;
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
            }
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if (Math.abs(a[i] - a[j]) > 1) {
                        f = 1;
                        break;
                    }
                }
            }
            if (f == 1) {
                System.out.println("No");
            } else {
                System.out.println("Yes");
            }
            t -= 1;
        }
    }
    }


import java.util.Arrays;
import java.util.Scanner;

public class Ex52 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int t=s.nextInt();
        while (t>0) {
            int n = s.nextInt();
            int[] a = new int[n];
            int f = 0;
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
            }
            Arrays.sort(a);
            for(int i=0,j=1; i<n; i++,j++){
                if(j < n){
                if(Math.abs(a[i] - a[j]) > 1) {
                    f = 1;
                    break;
                }
                }
            }
            if(f==1){
                System.out.println("NO");
            }
            else {
                System.out.println("YES");
            }
              t -= 1;
        }
    }
    }


package com.company;

import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException,ParseException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
//            sortArrayInt(arr);
//            boolean ok=true;
//            for (int i=1;i<n;++i){
//                if (arr[i]-arr[i-1]>1){
//                    ok=false;
//                    break;
//                }
//            }
//            if (ok){
//                out.print("YES");
//            }
//            else{
//                out.print("NO");
//            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


package com.company;

import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException,ParseException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
            sortArrayInt(arr);
            boolean ok=true;
            for (int i=1;i<n;++i){
                if (arr[i]-arr[i-1]>1){
                    ok=false;
                    break;
                }
            }
            if (ok){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


package com.company;

import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException,ParseException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
//            sortArrayInt(arr);
            boolean ok=true;
//            for (int i=1;i<n;++i){
//                if (arr[i]-arr[i-1]>1){
//                    ok=false;
//                    break;
//                }
//            }
            if (ok){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
//            sortArrayInt(arr);
            boolean ok=true;
//            for (int i=1;i<n;++i){
//                if (arr[i]-arr[i-1]>1){
//                    ok=false;
//                    break;
//                }
//            }
            if (ok){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


package com.company;

import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException,ParseException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
//            sortArrayInt(arr);
//            boolean ok=true;
//            for (int i=1;i<n;++i){
//                if (arr[i]-arr[i-1]>1){
//                    ok=false;
//                    break;
//                }
//            }
            if (ok){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private static final boolean OFFLINE_WITHOUT_FILES = false;

    void solve() throws IOException,ParseException{
        int t=readInt();
        while (t-->0){
            int n=readInt();
            int [] arr=new int[n];
            for (int i=0;i<n;++i){
                arr[i]=readInt();
            }
            sortArrayInt(arr);
            boolean ok=true;
            for (int i=1;i<n;++i){
                if (arr[i]-arr[i-1]>1){
                    ok=false;
                    break;
                }
            }
            if (ok){
                out.println("YES");
            }
            else{
                out.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Main();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;

    Main() {
        try {
            long timeStart = System.currentTimeMillis();
            if (ONLINE_JUDGE || OFFLINE_WITHOUT_FILES) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            tok = new StringTokenizer("");
            solve();
            out.close();
            long timeEnd = System.currentTimeMillis();
            System.err.println("time = " + (timeEnd - timeStart) + " compiled");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String delimiter = " ";

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (nextLine == null)
                return null;
            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken(delimiter);
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int[] sortArrayInt(int[] a) {
        Integer[] arr = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
        return a;
    }

    void sortArrayLong(long[] a) {
        Long[] arr = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            arr[i] = a[i];
        }
        Arrays.sort(arr);
        for (int i = 0; i < a.length; i++) {
            a[i] = arr[i];
        }
    }
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x=sc.nextInt();
			while(x-->0) {
				int g=sc.nextInt();
				int a[]=new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i]=sc.nextInt();
				}
				Arrays.sort(a);
				HashSet<Integer>xHashSet=new HashSet<Integer>();
				for (int i = 0; i < a.length; i++)
				{
					xHashSet.add(a[i]);
				}

				if (xHashSet.size()>2)
				{
					System.out.println("NO");
				}else {
					System.out.println("YES");

				}

			}
		}
	}
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x = sc.nextInt();
			while (x-- > 0)
			{
				int g = sc.nextInt();
				int a[] = new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i] = sc.nextInt();
				}
				Arrays.sort(a);
				HashSet<Integer> xHashSet = new HashSet<Integer>();
				for (int i = 0; i < a.length; i++)
				{
					xHashSet.add(a[i]);
				}

				int gg = 0;
				if (xHashSet.size() <= 1)
				{
					System.out.println("YES");
				} else if (xHashSet.size() == 2)
				{
					int nb[] = new int[2];
					int xx = 0;
					for (int i : xHashSet)
					{
						nb[xx] = i;
						xx++;
					}

					System.out.println("YES");

				} else
				{
					System.out.println("NO");
				}
			}
		}
	}
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x=sc.nextInt();
			while(x-->0) {
				int g=sc.nextInt();
				int a[]=new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i]=sc.nextInt();
				}
				Arrays.sort(a);
				if (Math.abs(a[0]-a[a.length-1])<=1)
				{
					System.out.println("YES");

				}else {
					System.out.println("NO");
				}
			}
		}
	}
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x=sc.nextInt();
			while(x-->0) {
				int g=sc.nextInt();
				int a[]=new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i]=sc.nextInt();
				}
				Arrays.sort(a);
				HashSet<Integer>xHashSet=new HashSet<Integer>();
				for (int i = 0; i < a.length; i++)
				{
					xHashSet.add(a[i]);
				}

				int gg=0;
				if (xHashSet.size()<=1)
				{
					System.out.println("YES");
				}else if(xHashSet.size()==2){
					int nb[]=new int[2];
					int xx=0;
					for(int i:xHashSet) {
						nb[xx]=i;xx++;
					}
					if (Math.abs(nb[0]-nb[1])<=1)
					{
						System.out.println("YES");
					}else {
						System.out.println("NO");
					}
				}else {
					System.out.println("NO");
				}
			}
		}
	}
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x = sc.nextInt();
			while (x-- > 0)
			{
				int g = sc.nextInt();
				int a[] = new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i] = sc.nextInt();
				}
				Arrays.sort(a);
				int xx =0;
				for (int i = 0; i < a.length-1; i++)
				{
					if (a[i]<=a[i+1] && a[i+1]-a[i]<=1 )
					{
						x++;a[i]=-1;
					}
				}
				int nb=0;
				for (int i = 0; i < a.length; i++)
				{
					if (a[i]!=-1)
					{
						nb++;
					}
				}
				if (nb>1)
				{
					System.out.println("NO");
				}else {
					System.out.println("YES");
				}

			}
		}
	}
}


import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.concurrent.PriorityBlockingQueue;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext())
		{
			int x = sc.nextInt();
			while (x-- > 0)
			{

				int g = sc.nextInt();
				int a[] = new int[g];
				for (int i = 0; i < a.length; i++)
				{
					a[i] = sc.nextInt();
				}
				Arrays.sort(a);

				for (int i = 0; i < a.length-1; i++)
				{
					if (a[i]<=a[i+1] && a[i+1]-a[i]<=1 )
					{
						a[i]=-1;
					}
				}
				int nb=0;
				for (int i = 0; i < a.length; i++)
				{
					if (a[i]!=-1)
					{
						nb++;
					}
				}

				if (nb>1)
				{
					System.out.println("NO");
				}else {
					System.out.println("YES");
				}

			}
		}
	}
}


import java.util.*;

public class Q1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            int size = in.nextInt();
            HashMap<Integer, Integer> map = new HashMap();
            int arr[] = new int[size];
            int min = Integer.MAX_VALUE;
            int minIndex = -1;
            for (int j = 0; j < size; j++) {
                arr[j] = in.nextInt();
                if (arr[j] < min) {
                    min = arr[j];
                    minIndex = j;
                }
                if (map.containsKey(arr[j])) {
                    map.put(arr[j], map.get(arr[j]) + 1);
                } else {
                    map.put(arr[j], 1);

                }

            }
            while (map.containsKey(min + 1) || map.get(min) > 1) {
                if (map.get(min) > 1) {
                    map.put(min, map.get(min) - 1);
                    continue;
                }
                if (map.containsKey(min + 1)) {
                    map.remove(min);
                    min = min + 1;
                }

            }
            if (map.size() > 1) {
                System.out.println("NO");
            } else {
                System.out.println("YES");

            }

        }
    }

    // public static void decodenum(int arr[]) {
    // HashMap<Integer, Integer> map = new HashMap();

    // for (int i = 0; i < arr.length; i++) {
    // if (!map.containsKey(arr[i])) {
    // System.out.print(arr[i] + " ");
    // map.put(arr[i], 1);

    // }
    // }
    // System.out.println();

    // }
}


import java.util.*;

public class Q1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            int size=in.nextInt();
            HashMap<Integer,Integer> map =new HashMap();
            int arr =new int[size];
            int min=Integer.MAX_VALUE;
            int minIndex=-1;
            for(int j=0;j<size;j++)
            {
                arr[i]=in.nextInt();
                if(arr[i]<min)
                {
                    min=arr[i];
                    minIndex=i;
                }
                if(map.containsKey(arr[i]))
                {
                     map.put(arr[i],map.get(arr[i])+1);
                }else {
                    map.put(i,arr[i]);

                }

            }
            while(map.containsKey(min+1)||map.get(min)>1)
            {
                if(map.get(min)>1)
                {
                    map.put(min,map.get(min)-1);
                    continue;
                }
                if(map.containsKey(min+1))
                {
                    map.remove(min);
                    min=min+1;
                }

            }
           if(map.size()>1)
           {
               System.out.println("NO");
           }else {
            System.out.println("YES");

           }

        }
    }

    // public static void decodenum(int arr[]) {
    //     HashMap<Integer, Integer> map = new HashMap();

    //     for (int i = 0; i < arr.length; i++) {
    //         if (!map.containsKey(arr[i])) {
    //             System.out.print(arr[i] + " ");
    //             map.put(arr[i], 1);

    //         }
    //     }
    //     System.out.println();

    // }
}


import java.util.*;

public class Q1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            int size=in.nextInt();
            HashMap<Integer,Integer> map =new HashMap();
            int arr[] =new int[size];
            int min=Integer.MAX_VALUE;
            int minIndex=-1;
            for(int j=0;j<size;j++)
            {
                arr[i]=in.nextInt();
                if(arr[i]<min)
                {
                    min=arr[i];
                    minIndex=i;
                }
                if(map.containsKey(arr[i]))
                {
                     map.put(arr[i],map.get(arr[i])+1);
                }else {
                    map.put(i,arr[i]);

                }

            }
            while(map.containsKey(min+1)||map.get(min)>1)
            {
                if(map.get(min)>1)
                {
                    map.put(min,map.get(min)-1);
                    continue;
                }
                if(map.containsKey(min+1))
                {
                    map.remove(min);
                    min=min+1;
                }

            }
           if(map.size()>1)
           {
               System.out.println("NO");
           }else {
            System.out.println("YES");

           }

        }
    }

    // public static void decodenum(int arr[]) {
    //     HashMap<Integer, Integer> map = new HashMap();

    //     for (int i = 0; i < arr.length; i++) {
    //         if (!map.containsKey(arr[i])) {
    //             System.out.print(arr[i] + " ");
    //             map.put(arr[i], 1);

    //         }
    //     }
    //     System.out.println();

    // }
}


import java.util.*;
import java.io.*;
public class Solution{
    static int[] nums;
    public static void main(String[] args) throws Exception{

        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buffer.readLine());
        while(t-- > 0){
            int N = Integer.parseInt(buffer.readLine());
            String[] i1 = buffer.readLine().split(" ");
            int count = N;
            for(int i=0; i<i1.length-1; i++){
                int n1 = Integer.parseInt(i1[i]);
                int n2 = Integer.parseInt(i1[i+1]);
                int diff = Math.abs(n1 - n2);
                if(diff <= 1){
                    if(n1 < n2)
                        i1[i] = Integer.toString(n2);
                    else
                        i1[i+1] = Integer.toString(n1);
                    count--;
                }
            }
            if(count == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }

    }

}


import java.util.*;
import java.io.*;
public class Solution{

    public static void main(String[] args) throws Exception{

        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buffer.readLine());
        while(t-- > 0){
            int N = Integer.parseInt(buffer.readLine());
            String[] i1 = buffer.readLine().split(" ");
            int count = N;
            for(int i=0; i<i1.length-1; i++){
                int n1 = Integer.parseInt(i1[i]);
                int n2 = Integer.parseInt(i1[i+1]);
                int diff = Math.abs(n1 - n2);
                if(diff <= 1){
                    if(n1 < n2)
                        i1[i] = Integer.toString(n2);
                    else
                        i1[i+1] = Integer.toString(n1);
                    count--;
                }
            }
            if(count == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }

    }

}


import java.util.*;
import java.io.*;
public class Solution{

    public static void main(String[] args) throws Exception{

        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buffer.readLine());
        while(t-- > 0){
            int N = Integer.parseInt(buffer.readLine());
            String[] i1 = buffer.readLine().split(" ");
            LinkedList<Integer> list= new LinkedList<Integer>();
            for(int i=0; i<i1.length; i++)
                list.add(Integer.parseInt(i1[i]));
            Collections.sort(list);
        /*
            for(int a : list)
                System.out.print(a + " ");
            System.out.println();
          */
            for(int j=0; j < list.size() - 1; j++){
                if((list.get(j) - list.get(j+1)) <=1 && (list.get(j+1) - list.get(j)) <= 1){
                    int temp = list.remove(j);
                    j--;
                 //   System.out.println(temp);
                }
            }

            if(list.size() == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

}


import java.util.*;
import java.io.*;
public class Solution{
    static int[] nums;
    public static void main(String[] args) throws Exception{

        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buffer.readLine());
        while(t-- > 0){
            int N = Integer.parseInt(buffer.readLine());
            String[] i1 = buffer.readLine().split(" ");
            int count = N;

            for(int i=0; i<i1.length-1; i++){
                for(int j=i+1; j<i1.length; j++){
                    int n1 = Integer.parseInt(i1[i]);
                    int n2 = Integer.parseInt(i1[j]);
                    int diff = Math.abs(n1 - n2);
                    if(diff <= 1){
                    if(n1 < n2)
                        i1[i] = Integer.toString(n2);
                    else
                        i1[j] = Integer.toString(n1);
                    count--;
                    break;
                    }
                }
            }
            if(count == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }

    }

}


import java.util.*;
import java.io.*;
public class Solution{

    public static void main(String[] args) throws Exception{

        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buffer.readLine());
        while(t-- > 0){
            int N = Integer.parseInt(buffer.readLine());
            String[] i1 = buffer.readLine().split(" ");
            int count = N;

            for(int i=0; i<i1.length-1; i++){
                for(int j=0; j<i1.length; j++){
                    int n1 = Integer.parseInt(i1[i]);
                    int n2 = Integer.parseInt(i1[j]);
                    int diff = Math.abs(n1 - n2);
                    if(diff <= 1){
                    if(n1 < n2)
                        i1[i] = Integer.toString(n2);
                    else
                        i1[j] = Integer.toString(n1);
                    count--;
                    break;
                    }
                }
            }
            if(count == 1)
                System.out.println("YES");
            else
                System.out.println("NO");
        }

    }

}


import java.util.*;

	public class GFG {

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();

			int count = 0;
			for(int i=0;i<n;i++) {
				int x = scan.nextInt();
				list.add(x);

			}

			for(int i=1;i<n;i++) {
				if(list.get(i-1)==list.get(i)) {
					count++;}
				if(list.get(i)==list.get(i-1)||list.get(i)==1+list.get(i-1)) {

					continue;
				}
				System.out.println("NO");
				continue x;
			}
			if(n-count>1) {
				System.out.println("NO");
				break;
			}
			System.out.println("YES");

		}
		}

	}


import java.util.*;

	public class GFG {

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();
			for(int i=0;i<n;i++) {

				list.add(scan.nextInt());

			}

			for(int i=1;i<n;i++) {

				if(list.get(i)>1+list.get(i-1)) {

					System.out.println("NO");
					continue x;
				}

			}

			System.out.println("YES");

		}
		}

	}


import java.util.*;

public	class GFG {
		public static String countFrequencies(ArrayList<Integer> list)
		{
			int count =0;
			Map<Integer, Integer> hm = new HashMap<Integer, Integer>();

			for (int i : list) {
				Integer j = hm.get(i);
				hm.put(i, (j == null) ? 1 : j + 1);
			}

			for (Map.Entry<Integer, Integer> val : hm.entrySet()) {
				if( val.getValue() >1)count++;
				if(count >1) return "NO";

			}
			return "YES";
		}

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();

//			int count = 0;
			for(int i=0;i<n;i++) {
				int x = scan.nextInt();
				list.add(x);

			}

			String s = countFrequencies(list);
			if(s == "NO") {

				System.out.println("NO");
				continue x;
			}
			for(int i=1;i<n;i++) {

				if(list.get(i)==list.get(i-1)||list.get(i)==1+list.get(i-1)) {

					continue;
				}
				System.out.println("NO");
				continue x;
			}

			System.out.println("YES");

		}
		}

	}


import java.util.*;

	public class GFG {

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();
			for(int i=0;i<n;i++) {

				list.add(scan.nextInt());

			}

			Collections.sort(list);
			for(int i=1;i<n;i++) {

				if(list.get(i)>1+list.get(i-1)) {

					System.out.println("NO");
					continue x;
				}

			}

			System.out.println("YES");

		}
		}

	}


import java.util.*;

public	class GFG {

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();

			for(int i=0;i<n;i++) {

				list.add(scan.nextInt(););

			}

			for(int i=1;i<n;i++) {

				if(list.get(i)>1+list.get(i-1)) {

						System.out.println("NO");
				continue x;
				}

			}

			System.out.println("YES");

		}
		}

	}


import java.util.*;

	public class GFG {
		public static String countFrequencies(ArrayList<Integer> list)
		{
			int count =0;
			Map<Integer, Integer> hm = new HashMap<Integer, Integer>();

			for (int i : list) {
				Integer j = hm.get(i);
				hm.put(i, (j == null) ? 1 : j + 1);
			}

			for (Map.Entry<Integer, Integer> val : hm.entrySet()) {
				if( val.getValue() >1)count++;
				if(count >1) return "NO";

			}
			return "YES";
		}

		public static void main(String[] args)
		{
			Scanner scan = new Scanner(System.in);
			int t = scan.nextInt();

			x: while(t-->0) {
				int n = scan.nextInt();
				ArrayList<Integer> list= new ArrayList<>();
				Map<Integer, Integer> hm = new HashMap<Integer, Integer>();
			int count = 0;
			for(int i=0;i<n;i++) {
				int x = scan.nextInt();
				list.add(x);
				Integer j = hm.get(x);
				hm.put(i, (j == null) ? 1 : j + 1);
			}
			for (Map.Entry<Integer, Integer> val : hm.entrySet()) {
	            if(val.getValue()>1)count++;
	        }
			if(count>1) {
				System.out.println("Na");
				break;
			}
			for(int i=1;i<n;i++) {
				if(list.get(i)==list.get(i-1)||list.get(i)==1+list.get(i-1)) {

					continue;
				}
				System.out.println("NO");
				continue x;
			}
			System.out.println("YES");

		}
		}

	}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Small {
	public static void main (String[] args) {
		Scanner sc= new Scanner(System.in);
		int t= sc.nextInt();
		while(t-->0){
		    int n = sc.nextInt();
		    int arr[]= new int[n];
		    for(int i=0;i<n;i++){
		        arr[i]= sc.nextInt();
		    }

		    int c=0;
		    for(int i=0;i<n-1;i++){
		        if(Math.abs(arr[i+1])-Math.abs(arr[i])<=1){
		            c++;
		        }
		        else{
		            System.out.println("NO");
		            break;
		        }
		    }
		    if(c==n-1){
		        System.out.println("YES");
		    }
		}
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Small {
	public static void main (String[] args) {
		Scanner sc= new Scanner(System.in);
		int t= sc.nextInt();
		while(t-->0){
		    int n = sc.nextInt();
		    int arr[]= new int[n];
		    for(int i=0;i<n;i++){
		        arr[i]= sc.nextInt();
		    }

		    int c=0;
		    for(int i=0;i<n-1;i++){
		        if(arr[i+1]-arr[i]<=1){
		            c++;
		        }
		        else{
		            System.out.println("NO");
		            break;
		        }
		    }
		    if(c==n-1){
		        System.out.println("YES");
		    }
		}
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;
public class Small {
	public static void main (String[] args) {
		Scanner sc= new Scanner(System.in);
		int t= sc.nextInt();
		while(t-->0){
		    int n = sc.nextInt();
		    int arr[]= new int[n];
		    for(int i=0;i<n;i++){
		        arr[i]= sc.nextInt();
		    }
		    Arrays.sort(arr);
		    int c=0;
		    for(int i=0;i<n-1;i++){
		        if(Math.abs(arr[i+1])-Math.abs(arr[i])<=1){
		            c++;
		        }
		        else{
		            System.out.println("NO");
		            break;
		        }
		    }
		    if(c==n-1){
		        System.out.println("YES");
		    }
		}
	}
}