#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define ld long double
#define MOD 1000000007
#define vec vector<int>
#define vecll vector<ll>
#define pb push_back
#define f(i, l, n) for (int i = l; i < n; i++)
#define fll(i, l, n) for (ll i = l; i <= n; i++)
#define regstuff                \
    int n;                      \
    cin >> n;                   \
    vec A(n);                   \
    for (int i = 0; i < n; i++) \
        cin >> A[i];
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
vec noprimes(1000001);

void seive(vec &primes, int n)
{
    //gives a prifix array of number of primes as well
    vector<bool> ntprimes(n + 1, false);
    ntprimes[0] = ntprimes[1] = true;
    for (int i = 2; i * i <= n; i++)
    {
        if (!ntprimes[i])
        {
            for (int j = i * i; j <= n; j += i)
            {
                ntprimes[j] = true;
            }
        }
    }
    int x = 0;
    for (int i = 2; i <= n; i++)
    {
        if (!ntprimes[i])
        {
            primes.pb(i);
            x++;
            noprimes[i] = x;
        }
        else
            noprimes[i] = x;
    }
}

ll pow(ll x, ll n)
{
    ll res = 1;
    while (n)
    {
        if (n % 2 == 0)
        {
            n = n / 2;
            x = x * x;
        }
        else
        {
            res *= x;
        }
    }
    return res;
}

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