accode:
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int T;
scanf("%d", &T);
while(T--)
{
int n, m;
scanf("%d %d", &n, &m);
vector<int> f(n + 2);
f[n + 1] = 1;
while (m--)
{
int v;
scanf("%d", &v);
f[v] = 1;
}
vector<pair<int, int>> size;
int have = 0;
int count = 0;
for (int i = 1; i <= n + 1; i++)
{
if (f[i])
{
if (have)
size.push_back(make_pair(have, count));
have = 0;
count += 1;
}
else
have += 1;
}
sort(size.begin(), size.end());
if(size.empty())
{
printf("YES\n");
continue;
}
int sum = 0;
for(auto s: size)
sum += s.first;
if(size.back().first <= sum - size.back().first + size.back().second)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}