/**
 * Prof.Nicola
**/
#include <bits/stdc++.h>

using namespace std;
template<class T>void re(T&x){cin>>x;}
template<class T1,class T2> void re(pair<T1,T2>&x){re(x.first);re(x.second);}
template<class T>void re(vector<T>&x){for(long i=0;i<x.size();i++){re(x[i]);}}
template<class T>void re(deque<T>&x){for(long i=0;i<x.size();i++){re(x[i]);}}
template<class T1,class T2> pair<T1,T2> mp(T1&x,T2&z){return make_pair(x,z);}
long k;
long solve(long x)
{
    if(x<k){
        return x;
    }
    return solve((x/k)+(x%k));
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long t,n,m,x,z;
    cin>>t;
    for(long i=0;i<t;i++){
        cin>>n>>k>>m;
        deque<long>v(m);
        re(v);
        if((n-m)%(k-1)!=0){
            cout<<"NO"<<endl;
            continue;
        }
        v.push_front(0);
        v.push_back(n+1);
        vector<long>pre(m),suf(m);
        x=0;
        for(long j=1;j<=m;j++){
            x+=v[j]-v[j-1]-1;
            pre[j-1]=x;
        }
        x=0;
        for(long j=m+1;j>1;j--){
            x+=v[j]-v[j-1]-1;
            suf[j-2]=x;
        }
        bool ok=false;
        for(long j=0;j<m;j++){
            x=solve(pre[j]);
            z=solve(suf[j]);
            if((x%(k/2)==0&&z==x)||(min(pre[j],suf[j])>=k/2)){
                ok=true;
                break;
            }
        }
        if(ok){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}
