#include <bits/stdc++.h>

using namespace std;
#define ll long long

int main()
{
    int t,n,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>n>>k>>s;
        int c = 0;
        for(int i=0;i<k;i++)
        {
            if(s[i] != s[n-1-i])
                c = 1;
        }
        if(n==2*k)
            c = 1;
        c==1 ? cout<<"NO" : cout<<"YES";
        cout<<endl;
    }
    return 0;
}
